Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 39

Pickers
Code is Art
Profile
Posts: 13
Reg: Oct 28, 2011
London
630
01/08/15 05:25 AM (9 years ago)

Device token / segmenting push messages

Hi, I've got a custom url calling a page containing dynamic events. A user can select which events they're interested on the page and I was hoping I could send segmented push notifications when specific events are updated. However, I'd need to associate a device token to an internal user id to do that but I'm not sure if obtaining the device token is even an option. If it's not, what would my options be? Cheers, Lee
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/08/15 07:58 AM (9 years ago)
I think parse.com may be worth looking at? They may do something close to what you want to do.
 
Pickers
Code is Art
Profile
Posts: 13
Reg: Oct 28, 2011
London
630
like
01/08/15 08:00 AM (9 years ago)
Thanks. I just have a feeling I'll have to migrate my external database or sync it with the parse backend to do what I want ... which will be a fair bit of work vs. simply bringing the device token into my db. Cheers, Lee
 
Pickers
Code is Art
Profile
Posts: 13
Reg: Oct 28, 2011
London
630
like
01/08/15 04:14 PM (9 years ago)
I've updated the BT_screen_customURL implementation file to append the device token as a parameter to my custom url's. After this: //escape bogus characters in URL NSString *escapedUrl = [useURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [self setExternalURL:escapedUrl]; Add this: NSString *lastDeviceToken = [BT_strings getPrefString:@"lastDeviceToken"]; escapedUrl = [escapedUrl stringByAppendingString:[NSString stringWithFormat:@"&deviceToken=%@", lastDeviceToken]]; N.B. this assumes your escapeURL already has get parameters e.g. ?name=value Cheers, Lee
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
01/09/15 12:48 PM (9 years ago)
I've got some code that gets you the device ID as a text string if needed
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.