phonegap-parse-plugin
phonegap-parse-plugin copied to clipboard
Subscriptions not being created
I can connect to the parse plugin and get the installation id but the subscriptions never get saved.
The code below outputs: Successfully connected to parse plugin Installation id: 123456 subscriptions: [] subscribed to own channel: userJ123 subscriptions: []
window.parsePlugin.initialize('abcdef', '123456',
function(success) {
console.log('Successfully connected to parse plugin');
// alert('success');
window.parsePlugin.getInstallationId(function(id) {
installationId = id;
console.log('Installation Id' + installationId);
window.parsePlugin.getSubscriptions(function(subs) {
subscriptions = subs;
console.log('subscriptions: ' + subs);
// subscribe user to itself
var userChannel = 'user' + Parse.User.current().id;
if (subscriptions.indexOf(userChannel) === -1) {
window.parsePlugin.subscribe(userChannel, function() {
console.log('subscribed to own channel: ' + userChannel);
// Test that subscribe is working
window.parsePlugin.getSubscriptions(function(subs) {
console.log('subscriptions: ' + subs);
});
}, function (e) {
console.log('error subscribing to own channel' + e);
});
}
console.log('subscriptions:', subs);
}, function (e) {
console.log('error' + e);
});
}, function(e) {
console.log('Error Getting ID: ' + e.code + ' : ' + e.message);
});
}, function(e) {
// alert('error');
console.log('error connecting to push with code: ' + e);
});
Am I supposed to pass the installation id to the subscribe method?
Thanks in advance.
Same issue here
This might be an issue if you are using a version of parse newer than 1.3.8. I've updated the plugin to work for parse 1.7 here https://github.com/ghmeier/phonegap-parse-plugin