avivais / phonegap-parse-plugin

Phonegap 3.0.0 plugin for Parse.com push service
195 stars 315 forks source link

Can this plugin save the user object to the installation object? #46

Open gespim opened 9 years ago

gespim commented 9 years ago

I need the Installation object has user attribute so that we can send push notification to a given set of users.

0x5d commented 9 years ago

Maybe you can try using the getInstallationId method?

gespim commented 9 years ago

No. I need to store the user id into Installation object of Parse. It is needed for later pushing to specific target user group. Could you guys update the plugin to make it possible?

From: castillobg [mailto:notifications@github.com] Sent: Thursday, April 09, 2015 2:16 PM To: avivais/phonegap-parse-plugin Cc: gespim Subject: Re: [phonegap-parse-plugin] Can this plugin save the user object to the installation object? (#46)

Maybe you can try using the getInstallationId method?

— Reply to this email directly or view it on GitHub https://github.com/avivais/phonegap-parse-plugin/issues/46#issuecomment-91316507 . https://github.com/notifications/beacon/AH2WIBcJHifQ8MQZdj8UkUfDZOyznBT8ks5n9rlKgaJpZM4D8Cvw.gif

gespim commented 9 years ago

I suggest the author add this function to be exposed to plugin user to call the userassignment to the installation object in parse

void ParsePushUserAssign(void) //------------------------------------------------------------------------------------------------------------------------------------------------- { PFInstallation installation = [PFInstallation currentInstallation]; installation[PF_INSTALLATION_USER] = [PFUser currentUser]; [installation saveInBackgroundWithBlock:^(BOOL succeeded, NSError error) { if (error != nil) { NSLog(@"ParsePushUserAssign save error."); } }]; }