2

I'm trying to set a title using Bluemix push notification when the unlocked style is in Alert mode, and seems like there is an option in apple documentation to set the Title according to Payload Keys https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW1, but I cannot see that option in Bluemix push rest API doc https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/messages/post_apps_applicationId_messages

And I cannot use silent push notification because it's not working when the app is killed by the user and it's not running --references BlueMix Push Notification - support for Apple localized alert messages And more reference https://forums.developer.apple.com/thread/31403

So I just can see that the title's tied to my application name, is there any way to change it not using silent push notification? enter image description here

I appreciate your answers

joe
  • 2,468
  • 2
  • 12
  • 19
Jan
  • 935
  • 8
  • 20

1 Answers1

0

As you saw in the Apple Documentation, you can set the title of an alert by setting the parameter title in the UIAlertController.

e.g.

@IBAction func buttonTapped(sender: AnyObject) {
  let alertController = UIAlertController(title: "iOScreator", message:
    "Hello, world!", preferredStyle: UIAlertControllerStyle.Alert)
  alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.Default,handler: nil))

  self.presentViewController(alertController, animated: true, completion: nil)
}

alert

See this article for more information on that.


Now it looks like your other question is asking if you can set a title parameter from your actual push notification for the alert.

This isn't supported out of the box, but you could send it as an Additional Payload parameter and parse this parameter when you receive the push notification from your device.

payload

So you would:

  1. Send the notification with the title in the Additional Payload
  2. Receive the notification from the device and get the title from it
  3. Set the title in the UIAlertController
joe
  • 2,468
  • 2
  • 12
  • 19
  • Thank you so much for your answer but I'm basically asking how can I set the title when it's a push notification is in Alert style if de device is unlocked no in a view controller inside the app, I have tried to set different configuration but event if I set it in the Additional Payload I had to use Silent push notification to get the title and launch a local push notification but unfortunately that does not work if the app is killed by the user which is explained in this link http://stackoverflow.com/questions/36407583/bluemix-push-notification-support-for-apple-localized-alert-messages – Jan Sep 01 '16 at 04:08
  • I see. Let me get in touch with the developers to see what options you have. – joe Sep 01 '16 at 04:22
  • So at this time your only option is going to be to send a silent notification and generate your own local notification. I shared your concerns with the service development team, and you can up a feature request here: https://ibm-bluemix.uservoice.com/forums/311383-ibm-bluemix-ideas/filters/top – joe Sep 01 '16 at 17:50
  • 1
    Thanks for the info :) – Jan Sep 01 '16 at 20:20