从这里开始:
https://github.com/ibm-bluemix-mobile-services/bms-samples-cordova-hellopush
我从 git 建立了一个新的本地 cordova 项目。
要将它与 ionic.io 一起使用,我还需要两个文件,package.json 和 ionic.config.json。
缺少的 package.json 是这样添加的:
{
"name": "exampleapp",
"version": "1.1.1",
"description": "ExampleApp: An Ionic project",
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-splashscreen",
"ibm-mfp-push",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
"ios",
{
"platform": "ios",
"version": "",
"locator": "ios"
}
]
}
和缺少的 ionic.config.json 文件
{
"name": "ExampleApp",
"app_id": ""
}
然后我打电话
ionic io 初始化
将此添加到我在 ionic.io 中的应用程序。
接下来,我在新应用的 ionic.io 中创建了一个新的开发者构建配置文件,其中包含所有 Apple 凭据和配置文件信息。
我将 bluemix 应用程序路由和 GUID 添加到 index.js 文件中。 (这些来自 bluemix 中的推送服务移动设置对话框)。
现在用
ionic package build ios --profile=dev
我构建了 ios 移动应用程序并将其下载到 iTunes 以将其安装到我的设备上。
应用程序安装没有错误,但什么也没做。
我错过了什么?
最佳答案
您需要使用最新版本的 IBM Bluemix Cordova Push 插件 bms-push
,而不是 ibm-mfp-push
。您还需要在实际的 iOS 设备而不是模拟器上运行您的应用程序来接收推送通知。
添加 bms-push
需要对 AppDelegate 文件进行一些更改。 Follow the instructions here将 bms-push
添加到您的项目。
关于ios - 如何在 ionic.io 项目中使用 IBM Bluemix BMS 移动推送通知服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41088080/