0
votes

I need to display alert message in notification center for both (iOS and Android) titanium App. I am using an enterprise apple account for my app.

I can play sound in the background service mode in titanium, but I also want to see alert message inside the notification center for my app.

Currently, I only see that inside General -> profile -> my verified entriprise application. How do I enable notification? I cant get alert text/badge in notification center and even there is no application settings inside settings in my iPad device.

This code is in place to register for push notifications:

Titanium.Network.registerForPushNotifications({
    types: [
        Titanium.Network.NOTIFICATION_TYPE_BADGE,
        Titanium.Network.NOTIFICATION_TYPE_ALERT,
        Titanium.Network.NOTIFICATION_TYPE_SOUND
    ],
    success:function(e)
    {
        var deviceToken = e.deviceToken;
        label.text = "Device registered. Device token: \n\n"+deviceToken;
        Ti.API.info("Push notification device token is: "+deviceToken);
        Ti.API.info("Push notification types: "+Titanium.Network.remoteNotificationTypes);
        Ti.API.info("Push notification enabled: "+Titanium.Network.remoteNotificationsEnabled);
    },
    error:function(e)
    {
        label.text = "Error during registration: "+e.error;
    },
    callback:function(e)
    {
        // called when a push notification is received.
        alert("Received a push notification\n\nPayload:\n\n"+JSON.stringify(e.data));
    }
});

How do I get notification messages inside the application's notification center section?

1

1 Answers

0
votes

My assumptions from your questions:

  • You want to use Appcelerator Arrow Push to send a push notification using https://platform.appcelerator.com
  • You want the push notification to appear in the iOS Notification Centre

You code does not show that you actually send the deviceToken to Arrow or any other back-end where you'd send the push notification.

Please follow: https://appcelerator.github.io/appc-docs/latest/#!/guide/Subscribing_to_push_notifications-section-37551717_Subscribingtopushnotifications-SubscribingtoPushNotificationswithDeviceTokens

The app does not control where a push notification appears. This is controlled in iOS via Settings > Notifications per app.