私のVoipアプリはバックグラウンドモードで使用していますが、バックグラウンドモードになると私のVoIPアプリケーションが起動します。到着すると、通知が表示されます。私はIOS 8以降でそれを見たsetKeepAliveTimeoutはもう働かないと私たちはプッシュキットを使用する必要があります、とにかく私たちのサーバー側をコーディングせずにpushKitを使用するには?先に行くVoip Appのバックグラウンドを使用する方法
- (void)registerKeepAliveHandler:(UIApplication*) application
{
LogInfo(TAG_MAIN, @"Registering KeepAliveTimeout");
[application setKeepAliveTimeout:600 handler:^{
[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_KEEPALIVE_RECEIVED object:nil];
NSMutableString* statusStr = [[NSMutableString alloc] init];
switch ([[UIApplication sharedApplication] applicationState]) {
case UIApplicationStateActive:
[statusStr appendString:@"foreground"];
break;
case UIApplicationStateInactive:
[statusStr appendString:@"inactive"];
break;
case UIApplicationStateBackground:
[statusStr appendString:@"background"];
break;
default:
assert(0);
break;
}
LogInfo(TAG_MAIN, @"===================================== Keepalive received in %@ application status ===============================", statusStr);
[UIApplication getIPAddress];
LogInfo(TAG_MAIN, @"%@", [[UIDevice currentDevice] batteryInfo]);
[[SipEngine sharedInstance] isServerReachable];
[[SipEngine sharedInstance] isRegistered];
[[SipEngine sharedInstance] startStopRegistration];
[[[SipEngine sharedInstance] registration] registering];
}];
}
こんにちは@ハシャ、ありがとうございます。上記の関数をNSLog(@ "didReceiveIncomingPushWithPayload")の代わりに使用したい場合は、私は何を使う必要があるか考えていますか?この方法ではうまくいかないからです。 – Steven
歓迎@スティーブン、私の答えがあなたを助けたならば、それをアップヴォートして受け入れることができます。私がいつでもあなたを助けることができるかどうか教えてください。 – Hasya
Pushkitペイロードを受け取ることができますか?はいの場合はプッシュキットペイロードに基づいて、着信音でローカル通知をスケジュールできます。また、対話的なイベントを追加してcall.https://github.com/hasyapanchasara/PushKit_SilentPushNotification/issues/1を受け入れるか拒否することができます – Hasya