我是这个Cordova /离子项目,我正在使用Parse作为后端. 我希望用户能够向其他用户发送消息.这样做时,推送通知应出现在接收者的设备上. 这应该适用于Android和iOS. 只使用Ionic和Parse会有可能
          我希望用户能够向其他用户发送消息.这样做时,推送通知应出现在接收者的设备上.
这应该适用于Android和iOS.
只使用Ionic和Parse会有可能吗?
我正在做一个类似的项目.以下是获得基本构思的一些步骤
一个.注册Parse.com
湾对于使用Ionic项目进行构建,您需要一个用于访问Parse组件的JS插件.使用此GitHub Plugin
C.将以下代码复制粘贴到app.js中的ionicPlatformReady()中
// You'll get the appId and Clinet Key from Parse.com
parsePlugin.initialize(appId, clientKey, function() {
parsePlugin.subscribe('SampleChannel', function() {
    parsePlugin.getInstallationId(function(id) {
        /**
         * Now you can construct an object and save it to your own services, or Parse, and corrilate users to parse installations
         * 
         var install_data = {
            installation_id: id,
            channels: ['SampleChannel']
         }
         *
         */
    }, function(e) {
        alert('error');
    });
}, function(e) {
    alert('error');
});
}, function(e) {
alert('error');
}); 
 d.从Parse帐户仪表板发送推送通知以进行测试,您应该能够看到它.
注意
您很可能会收到错误消息,指出未定义的parsePlugin.这意味着执行时不会加载cordova插件.
我希望它有所帮助.祝一切顺利.
谢谢,
