0

私は問題が何であるか分かりません。パースサーバーとイオンアプリ(ios)からのプッシュ通知を受け取ることができません

最初にiosを試してみてください。

私はパースサーバーのオープンソースからプッシュ通知をしています。私はこのプラグインhttps://github.com/phonegap-build/PushPluginを使用しています

"push": { 
     "ios":{ 
     "pfx": "/var/www..../Certificates.p12", 
     "passphrase": "...", 
     "bundleId": "com.xxxx.testPushNotification", 
     "production": false 
     } 
    } 

:私はプッシュのための解析サーバを設定します。ここで彼らは私のプラットフォームは、私は、メッセージのいくつかを送ったので、app.jsのコードが

$("#app-status-ul").append('<li>registering ' + device.platform + '</li>'); 
    pushNotification.register(
    tokenHandler, 
    errorHandler, 
    { 
     "badge":"true", 
     "sound":"true", 
     "alert":"true", 
     "ecb":"onNotificationAPN" 
    }); 
// result contains any message sent from the plugin call 
function successHandler (result) { 
    alert('result = ' + result); 
} 
// result contains any error description text returned from the plugin call 
function errorHandler (error) { 
    alert('error = ' + error); 
} 
function onNotificationAPN (event) { 
    if (event.alert) 
    { 
     navigator.notification.alert(event.alert); 
    } 

    if (event.sound) 
    { 
     var snd = new Media(event.sound); 
     snd.play(); 
    } 

    if (event.badge) 
    { 
     pushNotification.setApplicationIconBadgeNumber(successHandler, errorHandler, event.badge); 
    } 
} 
    function tokenHandler (result) { 
     // Your iOS push server needs to know the token before it can push to this device 
     // here is where you might want to send it the token for later use. 
     alert('device token = ' + result); 
    } 
    // fired when push notification is received 
    window.onNotification = function (e) { 
     navigator.notification.alert('Notification received: ' + JSON.stringify(e)); 
    } 
    var pushNotification = window.plugins.pushNotification; 
    pushNotification.register(successHandler, errorHandler, {"channelName":"xxxx","ecb":"onNotification"}); 

    function successHandler(result) { 
     console.log('registered###' + result.uri); 
     // send uri to your notification server 
    } 
    function errorHandler(error) { 
     console.log('error###' + error); 
    } 

基本的に私は、サーバー側を管理することができている

Installed platforms: 
    ios 4.3.1 
Available platforms: 
    amazon-fireos ~3.6.3 (deprecated) 
    android ~6.0.0 
    blackberry10 ~3.8.0 
    browser ~4.1.0 
    firefoxos ~3.6.3 
    osx ~4.0.1 
    webos ~3.7.0 

cordova 6.4.0 

とここにあるが、実際には送信されません。

please click to see picture

私は.P12と.PEMを取得するために管理し、アプリケーションIDは、アプリケーションとサーバ側との間で一致しています。

どこに問題がありますか?ヘルプをいただければ幸いです。

答えて

0

私は、自分自身私の答えを見つけ、それは(deviceReady内

に役立ちます願っています)

if(window.ParsePushPlugin){ 
    ParsePushPlugin.getInstallationId(function(id) { 
    // note that the javascript client has its own installation id, 
    // which is different from the device installation id. 
     alert("device installationId: " + id); 
    }, function(e) { 
     alert('error'); 
    }); 

    ParsePushPlugin.getSubscriptions(function(subscriptions) { 
     alert(subscriptions); 
    }, function(e) { 
     alert('error'); 
    }); 

    ParsePushPlugin.subscribe('SampleChannel', function(msg) { 
     alert('OK'); 
    }, function(e) { 
     alert('error'); 
    }); 

    ParsePushPlugin.unsubscribe('SampleChannel', function(msg) { 
     alert('OK'); 
    }, function(e) { 
     alert('error'); 
    }); 
    ParsePushPlugin.on('receivePN', function(pn){ 
     alert('yo i got this push notification:' + JSON.stringify(pn)); 
    }); 

//内部のconfig.xml

<preference name="ParseAppId" value="xxxxxx" /> 
<preference name="ParseServerUrl" value="http://xxxxx:1389/parse" /> 
<preference name="ParseGcmSenderId" value="xxxxxx" /> 
<preference name="ParseMultiNotifications" value="true" /> 

プラグイン:https://github.com/taivo/parse-push-plugin

お知らせ: appId(アプリバンドル)をサーバーとアプリの間で同じに設定し、p12とpe mファイルをあなたのアプリのルートフォルダに保存します。

関連する問題