###前提・実現したいこと
Objective-CでAPNsサーバからのリモート通知受信プログラムを作成しています。
softbankのiphone10.2.1で通話中にリモート(プッシュ)通知を受信できるようにしたいです。
###発生している問題・エラーメッセージ
通話中にリモート(プッシュ)通知を受信できません。(didreceiveremotenotificationイベントが呼ばれません。)
通話中でも該当のアプリケーションを前面にすると通知されますが、通話の画面が前面にあると通知されません。
###該当のソースコード
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Push [[UIApplication sharedApplication] unregisterForRemoteNotifications]; //iOS8対応 NSString *currentVersion = [[UIDevice currentDevice] systemVersion]; if([currentVersion compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending){ // iOS7以前の処理 [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; } else { // iOS8の処理 UIUserNotificationType types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; [[UIApplication sharedApplication] registerForRemoteNotifications]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; } return YES; } -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { // 中略 completionHandler(UIBackgroundFetchResultNewData); }
###試したこと
ペイロードで送信するAPS辞書の値は「content-available=1」にして、バックグラウンドでサイレント通知するようにしています。
###補足情報(言語/FW/ツール等のバージョンなど)
言語:Objective-C
開発ツール:XCode Ver8.1

あなたの回答
tips
プレビュー