williamrijksen / com.williamrijksen.onesignal

Titanium Appcelerator Library for OneSignal Push Notifications Service
Other
51 stars 43 forks source link

iOS media attachments #55

Open agrycroko opened 6 years ago

agrycroko commented 6 years ago

Hi all, so as of now, January 20th 2018, what's the process for getting media links to show as little thumb images on iOS. I put a media url (https and ending with .png) into the OneSignal push field but only the message is displayed, not the thumb image. iOS 11.2 app in development mode on iPhone X. Ti SDK 7.0.1

jvandijk commented 6 years ago

I haven't played with rich media notifications yet. I do know this requires additional processing inside the app upon receiving the data from OneSignal. How exactly.... I can't tell you.

jkasten2 commented 6 years ago

Rich media notifications work on iOS 10+ and requires that a Notification Service Extension target be added to your project in Xcode. There is a guide below on creating one and setting it up with the OneSignal SDK. https://documentation.onesignal.com/docs/ios-sdk-setup#section-1-add-notification-service-extension

agrycroko commented 6 years ago

@jkasten2 - thx I was kinda looking along that route but couldn't get it to work. I was building the extension in Xcode and then dropping into my Titanium SDK 7.0.1 Alloy project. I tried adapting this tutorial to use a Notification Service Extension rather than the Siri one they're talking about: https://docs.appcelerator.com/platform/latest/?mobile=/guide/Creating_iOSExtensions-_Siri_Intents - anyhow something's missing and not wired up correctly. Any thoughts or successful code you can share? Thanks.

jkasten2 commented 6 years ago

@garycrook I haven't used Titanium before but since the Notification Service Extension is it's own target and ends up in it's own process it shouldn't be effected. If the code you added is compiling and linking correctly it should be working.

To ensure the Notification Service Extension is being triggered however I recommend following this troubleshooting guide. https://documentation.onesignal.com/docs/troubleshooting-ios#section-debug-the-notification-service-extension

agrycroko commented 6 years ago

Thank you @jkasten2 I will investigate.

DharmeshRathod712 commented 6 years ago

@garycrook even I am caught up with the same issue. Did you find any solution? Thumbnail image is not visible, only message is visible when notification is received in notification bar. But I am receiving the url of image in notificationOpened and notificationReceived eventListeners. I tried to create native Xcode project and integrated OneSignal module in it as mentioned here https://documentation.onesignal.com/docs/ios-sdk-setup and it is displaying the Thumbnail icon.

agrycroko commented 6 years ago

@User712 no I didn't 😒

In the end I moved over to using Firebase for push (not rich ones, just standard). I'm using @hansemannn's excellent titanium-firebase modules.

Good luck!

[UPDATE] P.S. If you can hold on, rich notifications are part of the upcoming Titanium SDK 7.2.0 release 😉

DharmeshRathod712 commented 6 years ago

@garycrook actually my app is already live with OneSignal. And every other thing is working fine with OneSignal Module, only problem is media attachment is not visible as a thumbnail. @williamrijksen I will be very thankful if you can help us with the work around or any temporary solution until it is fixed.

[UPDATE] After doing little R&D on OneSignal module I found that there is a method +(UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; which can be used for iOS Media Attachments and Action buttons, but I don't know how to work with it.

SilvioLuis commented 5 years ago

Any solution for this?