Advertisement
InnovativeIdeas

Untitled

Dec 11th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. NSString* template = [NSString stringWithFormat:@"{\"aps\":{\"alert\":\"$(News_%@)\"},\"inAppMessage\":\"$(News_%@)\"}", localeString, localeString];
  2.  
  3.  
  4.  
  5. public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
  6. {
  7. Hub = new SBNotificationHub(TnOConstants.AzureListenConnectionString, TnOConstants.AzureNotificationHubName);
  8.  
  9. Hub.UnregisterAllAsync (deviceToken, (error) => {
  10. if (error != null)
  11. {
  12. Console.WriteLine("Error calling Unregister: {0}", error.ToString());
  13. return;
  14. }
  15.  
  16. string[] tag = new string[]{"tnoios", "ios-"+ appVersion.ToString()};
  17.  
  18. NSSet tags = new NSSet(tag);
  19. Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) => {
  20. if (errorCallback != null)
  21. Console.WriteLine("RegisterNativeAsync error: " + errorCallback.ToString());
  22. });
  23.  
  24. String template = String.Format("@\"{\\\"aps\\\":{\\\"alert\\\":\\\"$(News_%@)\\\"},\\\"inAppMessage\\\":\\\"$(News_%@)\\\"}\"");
  25. string name="";
  26. string jsontemplate="";
  27. string expirytemplate="";
  28.  
  29.  
  30.  
  31. // Hub.RegisterTemplateAsync(deviceToken, name,jsontemplate,expirytemplate, tags, (errorCallback) => {
  32. // if (errorCallback != null)
  33. // Console.WriteLine("RegisterNativeAsync error: " + errorCallback.ToString());
  34. // });
  35. });
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement