2017-01-05 1 views
1

iPhone (iOS 10)이 닫힌 상태 인 경우 전화를 걸 수 없습니다.Sinch - 닫힌 상태에서 통화가 시작되지 않습니다.

전화로 푸시 킷 서비스를 사용하고 있습니다. 앱이 백그라운드에있는 경우 전화가 걸리지 만 앱이 닫힌 상태이면 알림이 서버에서 수신되지만 통화가 시작되지 않습니다.

_client 개체가 0이 아닙니다.

나는 아래의 코드 :: 아래

- (void)initSinchClientWithUserId:(NSString *)userId 
{  
    if (!_client) { 

     if(userId.length <= 0) 
      return; 


     _client = [Sinch clientWithApplicationKey:SINCH_APP_KEY 
             environmentHost:SINCH_ENVIRONMENT_HOST 
               userId:userId]; 

     _client.delegate = self; 
     _client.callClient.delegate = self; 
     [_client setSupportCalling:YES]; 

     [_client setSupportActiveConnectionInBackground:YES]; 

     [_client setSupportPushNotifications:YES]; 
     [_client start]; 

     [_client startListeningOnActiveConnection]; 

    } 

} 

에 의해 SINCH 클라이언트를 초기화하고는 코드가 방법

-(void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type 
{ 

    NSDictionary* dic = payload.dictionaryPayload 

    if([dic.allKeys containsObject:@"sin"]) 
    { 
     NSString* sinchinfo = [dic objectForKey:@"sin"]; 

     if (sinchinfo == nil) 
      return; 

     dispatch_async(dispatch_get_main_queue(), ^{ 
      [_client relayRemotePushNotificationPayload:sinchinfo]; 
     }); 
    } 
} 

참고 : 나는 아이폰 OS 9에서 확인이, 그것은이 작동 didReceiveIncomingPushWithPayload입니다 아래의 방법이 제대로 호출됨에 따라

- (SINLocalNotification *)client:(id<SINClient>)client localNotificationForIncomingCall:(id<SINCall>)call 
{ 

} 
+0

동일한 문제에 직면하여 앱이 완전히 종료되어있는 동안 전화를받을 수 없습니다. 생성 된 호출에 대한 로컬 알림/원격 알림이 없습니다. 또한 클라이언트가 올바르게 시작되었는지 확인하십시오. –

+0

iOS 10 용 NSUserNotification을 사용해 보셨습니까 ?? –

+0

@VishalSonawane 로컬 알림에 문제가 없습니다. ** SINCH SDK **의 대리자 메서드 **에 문제가 있습니다. iOS10에서는 호출되지 않습니다. –

답변

1

Sinch 초기화를 위해이 코드를 사용해보십시오 :

1.viewController

@property (nonatomic, readwrite, strong) id<SINManagedPush> push; 

2에서 속성을 선언 AppDelegate (didFinishLaunchingWithOptions)

//Sinch managed Push Notifications 
    self.push = [Sinch managedPushWithAPSEnvironment:SINAPSEnvironmentAutomatic]; 
    self.push.delegate = self; 
    [self.push setDesiredPushTypeAutomatically]; 
    //Sinch Remote notifications 
    id config = [[SinchService configWithApplicationKey:SINCH_KEY 
             applicationSecret:SINCH_SECRET 
             environmentHost:SINCH_HOST] 
       pushNotificationsWithEnvironment:SINAPSEnvironmentProduction]; 

    id<SINService> sinch = [SinchService serviceWithConfig:config]; 
    sinch.delegate = self; 
    sinch.callClient.delegate = self; 
코드 아래 추가

마침내

- (void)initSinchClientWithUserId:(NSString *)userId { 
    if (!_client) { 
     _client = [Sinch clientWithApplicationKey:SINCH_KEY 
           applicationSecret:SINCH_SECRET 
            environmentHost:SINCH_HOST 
              userId:userId]; 

     _client.delegate = self; 
     _client.callClient.delegate = self; 
     [_client setSupportCalling:YES]; 
     [_client enableManagedPushNotifications]; 
     [_client start]; 
    } 
} 
관련 문제