Bluemix Cordova Hello World サンプルを IBMPushNotifications Service と連携させようとしています。コルドバ プラグインをインストールしました。コルドバ プラグイン リストを実行すると、次のように表示されます。
ibm-mfp-core 1.0.10 "MFPCore"
ibm-mfp-push 1.0.12 "MFPPush"
私の index.js 初期化コードは次のようになります。
onDeviceReady: function() {
BMSClient.initialize(app.route, app.guid);
BMSClient.registerAuthenticationListener("MyRealm", customAuthenticationListener);
// alert("******** ABOUT TO CALL MFPPush.registerDevice **************");
// MFPPush.registerDevice(iosPushSettings, pushSuccess, pushFailure);
MFPPush.registerDevice({}, pushSuccess, pushFailure);
MAS customAuthentication サービスを実行して動作させています。
Xcode経由で接続されたiPadでコードを実行しています。プラグインの迅速なファイル内にいくつかの debugPrint ステートメントを追加したところ、Xcode コンソールに次のメッセージが表示されます。
"Inside Register Device!!!!!!!"
"Inside registerNotificationsCallback"
"Settings Parameter is not null"
"settings.count == 0"
"about to set notificationSettings"
"About to registerForRemoteNotifications"
"Called registerForRemoteNotifications"
私は Swift や iOS の開発者ではないので、iOS アプリのデバッグや操作についてはまったく無知です。ファイルにブレークポイントを設定しようとしましたAppDelegate.m
が、コードがブレークポイントに到達しているように見えdidRegisterForRemoteNotificationsWithDeviceToken
、トークン値が設定されていると思います。CDVMFPPush.swift
ただし、内部のファイルで debugPrint コードがトリガーされることはありません
func didRegisterForRemoteNotifications(deviceToken: NSData) {
debugPrint("Inside didRegisterForRemoteNotifications")
または内部
func didFailToRegisterForRemoteNotifications(error: NSError) {
debugPrint("Inside didFailToRegisterForRemoteNotifications")
私が知る限り、APNS 証明書とプロビジョニング プロファイルをセットアップし、sandboxAPNS.p12
ファイルをエラーなしで Bluemix Push サービスにアップロードしました。
Bluemix プッシュ ダッシュボードで、すべてのデバイスにプッシュ通知を送信しようとすると、次のエラーが表示されます。
Internal server error. No devices found
また、XCode のアプリの [機能] タブで PushNotifications が有効になっていることもわかります。
didRegister
orの debugPrint ステートメントが表示されdidFailToRegister
ない理由と、Bluemix がデバイスを認識しない理由を突き止めようとしています。デバッグ方法についてご提案いただきありがとうございます。また、Swift と XCode に関する私の無知についてお詫び申し上げます。
JT