2017-11-02 1 views
1

iPhone 6에서 내 앱을 실행하는 중에 오류가 발생합니다. VoIP 기능을 구현하려고합니다.iPhone 6에 voip 앱을 설치할 수 없습니다.

enter image description here

이에 대한 해결책은 무엇인가? 어떤 도움을 주시면 감사하겠습니다. 감사.

아래의 코드를 VoIP 기능으로 사용하고 있습니다.

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { 



     let voipRegistry = PKPushRegistry(queue: DispatchQueue.main) 
     voipRegistry.desiredPushTypes = [PKPushType.voIP] 
    voipRegistry.delegate = self; 

}

extension AppDelegate : PKPushRegistryDelegate { 
    func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) { 
    NSLog("PusRegistry didUpdateCredential....") 
    let deviceTokenString: String = pushCredentials.token.map { String(format: "%02.2hhx", $0) }.joined() 
    NSLog("PushCredentials: \(deviceTokenString)") 

    UIPasteboard.general.string = deviceTokenString 

showLocalNotifiacation(text: "Received pushCredential") 

    NSLog("Token is : \(deviceTokenString)") 
} 


func pushRegistry(_ registry: PKPushRegistry, 
     didInvalidatePushTokenFor type: PKPushType) { 
} 

func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) { 
    NSLog("<><><><><><><><><><><><><><><><><>><><><><><><><>><><>><><><><><") 
    NSLog("<><><><><><><><><><><><><><><><><>><><><><><><><>><><>><><><><><") 
    NSLog("<><><><><><><><><><><><><><><><><>><><><><><><><>><><>><><><><><") 
    NSLog("<><><><><><><><><><><><><><><><><>><><><><><><><>><><>><><><><><") 
    NSLog("<><><><><><><><><><><><><><><><><>><><><><><><><>><><>><><><><><") 
    NSLog("<><><><><><><><><><><><><><><><><>><><><><><><><>><><>><><><><><") 
    NSLog("<**************** Syncing data because of VOIP ***************") 
    sharedSilentPushSyncManager.syncDataForOperation("Syncing... for voip") 
    showLocalNotifiacation(text: "Received voip push") 
} 

}

+0

귀하의 노력은 무엇입니까? –

+0

xcode를 사용하여 앱을 실행하려고합니다. –

+0

해당 프로필에 대해 기기를 등록하셨습니까? – Rivendell

답변

0

이 하나를 시도!

1. Xcode를 엽니 다.
2. 프로젝트로 이동 대상.
3. 기능 탭을 클릭하십시오.
4. 다음 스크린 샷을 확인하고 활성화 푸시 알림, 배경 모드 기능.

enter image description here

enter image description here

5.check 당신의 의 Info.plist 프로젝트의.

enter image description here

6.Check 설정은 위의 정보를 제공하고이를 수정합니다.

감사합니다.

관련 문제