私たちはmfp8.0でionic appを開発しています。私たちは、次のコードを使用してmfpサーバーに接続します。MFP8.0でデバイスを登録できません
var Messages = {
// Add here your messages for the default language.
// Generate a similar file with a language suffix containing the translated messages.
// key1 : message1,
};
var wlInitOptions = {
// Options to initialize with the WL.Client object.
// For initialization options please refer to IBM MobileFirst Platform Foundation Knowledge Center.
onSuccess:function(){alert('success')},
onFailure:function(){alert('fail')}
};
function wlCommonInit() {
app.init();
}
var app = {
//initialize app
"init": function init() {
app.testServerConnection();
},
//test server connection
"testServerConnection": function testServerConnection() {
WL.App.getServerUrl(function (url) {
});
WLAuthorizationManager.obtainAccessToken()
.then(
function (accessToken) {
alert('accessToken '+JSON.stringify(accessToken));
isPushSupported();
},
function (error) {
alert('Error '+error);
}
);
},
}
function isPushSupported() {
MFPPush.isPushSupported(
function(successResponse) {
alert("Push Supported: " + successResponse);
registerDevice();
}, function(failureResponse) {
alert("Failed to get push support status");
}
);
}
function registerDevice() {
WLAuthorizationManager.obtainAccessToken("push.mobileclient").then(
MFPPush.registerDevice(
{"phoneNumber":""}, // workaround due to a defect in the current release of the product. An empty "phoneNumber" property must be passed at this time.
function(successResponse) {
alert("Successfully registered");
},
function(failureResponse) {
alert("Failed to register");
alert("Failed to register device:" + JSON.stringify(failureResponse));
}
)
);
}
私たちはmfpサーバーに接続することができます。しかし、プッシュ通知のためのデバイスを登録できませんでした。私たちは、実際には、我々は最近、このエラーを取得している、
"com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushException:Response:Status=404, Text:Error 404: SRVE0295E: Error reported: 404\r\n, Error Message : Not Found"
(または)
"com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushException:Response:Status=500,Text:{\"errorCode\":\"UNEXPECTED_ERROR\",\"errorMsg\":\"Unexpected Error Encountered\"}, Error Message : Unexpected Error Encountered"
を次のエラーを取得しています。その前に、同じコードが私たちのためにうまくいきました。
誰もが助けてくれます!
。 suddently、それは動作しません。それは私がこの質問を提起したものです。 –
更新されたSDKとサーバーインスタンスを使用していることを確認してください。最新のSDKでは、phoneNumberの回避策は必要ありません。最新のAPIについては、コードバのチュートリアルを参照してください。 –