I have to send push notifications to the specific users from the azure database list on insert of column into table. I am not sure which way I should I use direct APNS or Notifications hub?
1) If i use direct APNS from azure(below insert query), on insert of column in table TODOITEM I gets the push notification , but What should i do to send it to specific user from table
I figured out null
should be replaced with tokens where do I get specific user tokes
function insert(item, user, request) {
request.execute();
setTimeout(function() {
push.apns.send(null, {
alert: "Alert: " + item.text,
payload: {
inAppMessage: "Hey, a new item arrived: '" + item.text + "'"
}
});
}, 2500);}
2) If i use the notification hub, I am not even able to use the push notification on insert of column in table which was happening in first case. in IOS side, I am using code for notification hub:
SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString:
@"..
[hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) {
if (error != nil) {
NSLog(@"Error registering for notifications: %@", error);
}
}];
How do I send the notification on table insert as it was happening in case 1 and how do i send to specific user of table (is there any way i can query the table and send)
Please can you answer both the cases.