0
我正在尝试设置IBM Mobile First Push Notifications。订阅IBM Mobile时出现意外错误首先推送
我使用的是移动第一个平台7.1.0.00.20151107-1653
我做了什么至今:
- 创建APNS沙盒证书并已将其列入到应用程序的根文件夹。在应用descriptor.xml
- 新增配置
- 进入推到代码我的适配器像https://github.com/MobileFirst-Platform-Developer-Center/EventSourceNotifications/blob/release71/adapters/PushAdapter/PushAdapter-impl.js
加推的初始化函数描述成我的客户端应用程序:
var isPushSupported = WL.Client.Push.isPushSupported(); if (isPushSupported) { WL.Client.Push.registerEventSourceCallback( "myPush", "MetaAdapter", "PushEventSource"); WL.Client.Push.subscribe("myPush", { onSuccess: function(){ alert("success"); }, onFailure: function(errorMsg){ alert(JSON.stringify(errorMsg)); } }); }else{ console.log('---> Push not supported by device') }
我之后推我的服务器上的代码(这也没有问题)我试图启动应用程序。在应用开始时,我允许使用典型的“您是否允许推送此应用的通知”问题。
现在,当执行发布代码时,onFailure错误消息显示为500 - Unexpected Error
。
在Xcode控制台I可以看到下面的输出:
{"errors":["A truncation error was encountered trying to shrink VARCHAR 'APP_NAME\/1.0.0 (iPhone; iOS 9.1; Scale\/2.00),Ma&' to length 254.
{prepstmnt 772646547 INSERT INTO PUSH_DEVICES (CREATED_MODE, CREATED_TIME, LAST_UPDATED_TIME, APPLICATION_ID, DEVICE_ID, ENVIRONMENT_ID, PUSH_KEY, LATITUDE, LOCALE, LONGITUDE, PLATFORM, STATUS, TOKEN, USER_AGENT, USER_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[params=(String) API, (String) 2015-11-30T19:56:15Z, (String) 2015-11-30T19:56:15Z, (String) app_identifier, (String) 54D7CA02-64BA-4644-85E2-B29A0811FE6B, (String)
app_identifier-1.0.0, (null) null, (null) null, (null) null, (null) null, (String) A, (int) 0, (String) ef65cf4638308d13de9af9e09704cfdd9fe1010d3dcd678feb2aa8cf61a4b855, (String)
APP_NAME\/1.0.0 (iPhone; iOS 9.1; Scale\/2.00),APP_NAME...,
(String) 6dcd1097-1aa0-4111-af44-3234c29079e0]} [code=20000, state=22001]"],"isSuccessful":false,"warnings":[],"info":[]}*/
的APP_NAME是21个字符长和app_identifier是长52个字符。
你有什么想法解决这个问题吗?
谢谢!