Closed somefakeuser closed 9 years ago
Ok... You are right!
My module don't deal with push notification provider integrations. It was tested with many providers to correctly handle the client events and differents payload data.
Each provider have it own api, different features and expects specific data.
By example, my module comes with a Parse api integration limited to device registration (minimal requirement to push notification lifecicle). It's only an example of use. It's not part of my module, but you can improve and extend the javascript Parse api example to send the CLICK, FOREGROUND or BACKGROUND events to the provider.
Unfortunately I don't have an aditional example to your needs.
That's all.
Regards,
Arley Andrada Maria
Hey Arley,
Thanks for the quick response! One more thing, just wondering how you set the icon for the notification on Android? To clarify, I'm referring to in your example code where you say:
// Notification properties:
// "alert" (String) to text message - or "text" to Android
// "sound" (String) to sound file to play - "default" to Android default sound
// "badge" (Int) to badge count indicator
// "content-available" (Int) to iOS background notification
// -->> Requires set remote-notification UIBackgroundModes in tiapp.xml
// "notificationId" (Int) to Android notification identification
// "title" (String) to override Android notification title - default app name
// "ticker" (String) to override Android ticker message - default alert message
// "vibrate" (Boolean) to use default Android device vibration
// "lights" (Boolean) to use default Android device lights
// "smallIcon" (String) set small icon to Android notification from assets
// "largeIcon" (String) set large icon to Android notification from
local file or url
// "category" (String) to iOS 8 interactive notification
// "ledARGB" (Color) to change default Android device light color
// "ledOnMS" (Int) to change default Android device light blink on time
// "ledOffMS" (Int) to change default Android device light blink off time
I'm looking for where to put the "smallIcon" or "largeIcon" property in before calling registerPush. I'm assuming I put it into registerOptions, but I've tried registerOptions.smallIcon and registerOptions.largeIcon to no avail. is it supposed to be in some sort of sub-property?
Thanks!
Use the "notification properties" in your payload data sent from Parse.
Use the JSON payload format.
Is it clear now?
Regards,
Arley
That's exactly what I'm confused about. I've got this so far:
var registerOptions = {
GCMSenderId : Alloy.CFG.ParseGCMSenderId,
APNTypes : [ PushClient.NOTIFICATION_TYPE_BADGE,
PushClient.NOTIFICATION_TYPE_ALERT, PushClient.NOTIFICATION_TYPE_SOUND
]
};
And this for android:
if (OS_ANDROID) {
registerOptions.title = "Hello World!";
registerOptions.smallIcon = "/images/current_location.png";
registerOptions.largeIcon = "/images/current_location.png";
}
but this isn't working. How do i need to structure the JSON object to correctly get this data across?
Thanks!
Use in the payload data sent from Parse. Not as registerOptions properties.
Access the Parse.com website and send a JSON message to the registered devices.
Something like this:
{ "alert" : "Hello World!", "vibrate" : true, "smallIcon" : "current_location.png", "largeIcon" : "http://myserver/path/image.png" }
Hey Arley,
I don't think you understood my question correctly, I was asking if there was a way to track the push opens on the Parse website, like when a push is open, it lets the Parse API know that it was received/opened.
One more question as well. Is there a way to set the notification icon for the push notification on Android? I'm assuming it's through the registerOptions, but I can't quite seem to figure it out...
Thanks,