Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20578] Windows: Support Notifications sent while in background

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-04-25T00:37:10.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 5.4.0
ComponentsWindows
Labelsn/a
ReporterJörgen Buder
AssigneeKota Iguchi
Created2016-03-16T12:34:47.000+0000
Updated2018-08-06T17:49:20.000+0000

Description

I looked at the parity API list form the nightly builds and I am not able to find any way to receive push notifications to a windows phone app, this is a much needed component to be able to increase usage and alert users of the app state and things to take action against. (I was also not able to find any local notifications to use as work around) This is needed in Windows Phone 8.1 and should be compatible with Win 10 mob .. Much appreciated...;)

Comments

  1. Christopher Williams 2016-03-16

    Similar to http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Notification https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj676791.aspx
  2. Jörgen Buder 2016-03-16

    quick comment on this. I am talking about push notifications. not the local ones found in android. you should compare it with APN in iOS and GCM in android. ...
  3. Jörgen Buder 2016-03-16

    so in fact not only as your link as it needs a callback to receive the GCM as well on android.. in iOS it is auto generated in windows I do not know yet...
  4. Jörgen Buder 2016-04-05

    So anyone have any update on this for the 5.3.0 release of Windows SDK? Some sort of notification system have to be in place, like the local notification OR the push notification.. Thanks
  5. Jörgen Buder 2016-04-05

    Or simply it needs to be possible to create native modules with Windows target
  6. Kota Iguchi 2016-04-19

    https://github.com/appcelerator/titanium_mobile_windows/pull/635
  7. Jörgen Buder 2016-04-19

    Hi Just a quick note, so this support goal is to be able to create notifications either from local or from push, NOTE that in my case I have to be able to do this from the backgrund service that I am trying to test now, so from my perceptive it feels like I have to create this notification in the native code then. On the other side (TI foreground app) I have to be able to create local notifications and preferably receive push notifications... Not sure tat makes sense but anyway...
  8. Jörgen Buder 2016-04-19

    I read your docs in the github PR, so if the push indeed works from the app perspective then it resolves "part" of the notification need in my background service (I wills till need to make local notifications though) but the over all push can push notification to the app.. this is good, I guess this is not yet merged..
  9. Kota Iguchi 2016-04-20

    [~buder] Do you consider specific Windows API to be used for push notification? Current PR is is only for Windows raw notification but there could be broader alternatives there. Actual use case and Windows API class name (or 3rd party libraries?) would be very helpful to define Titanium background service API spec.
  10. Jörgen Buder 2016-04-20

    Hi So I read about raw notifications here : https://msdn.microsoft.com/en-us/library/windows/apps/hh761463.aspx which sounds like something useful, but as far as I can see it does not create a notification in the top notification bar. Is it correct to assume that in windows, (like in Android) I have to crate a toast notification to alert the user that there is something going on? It sound like it reading the guide above. Please confirm if I am correct? Ideally the push notification would create that for us but I know Andorra is not working like that. With your implementation of the push notification I can receive a push in a native callback handler, correct? Then I can pull HTTP and create a toast notification form there that alerts the user to "enter" the app. I take it that a notification in the top bar in Windows Phone 8.1 (and 10) will indeed lead you to the app. This is a doable scenario however if there is NO OTHER way to create notifications in the Ti context maybe you should support toast notifications so that app can create notification in the top bar? I know some apps use this and set a art date and time top alert the user about upcoming notifications for instance. Is the toast notification in windows equivalent to local notification in Android ? I hope I was clear here. Is this push notification currently in the nightly builds? I have prepared for it... thanks
  11. Kota Iguchi 2016-04-20

    What's bad thing for MS docs are that it's very difficult to find valuable content from them :( I have confirmed that in order to show toast notification, you can use [ToastNotification](https://msdn.microsoft.com/library/windows/apps/br208641) that can be invoked from BackgroundServiceTask::Run. For more examples check out [ToastNotification Examples ](https://msdn.microsoft.com/library/windows/apps/br208641) or [Alarm toast notifications sample](https://code.msdn.microsoft.com/windowsapps/Alarm-toast-notifications-fe81fc74) etc.
        void BackgroundServiceTask::Run(IBackgroundTaskInstance^ taskInstance)
        {
        	const auto deferral = taskInstance->GetDeferral();
        
        	auto toastXml = Windows::UI::Notifications::ToastNotificationManager::GetTemplateContent(Windows::UI::Notifications::ToastTemplateType::ToastText01);
        	toastXml->GetElementsByTagName("text")->GetAt(0)->InnerText = "This is toast test";
        	auto notification = ref new Windows::UI::Notifications::ToastNotification(toastXml);
        	Windows::UI::Notifications::ToastNotificationManager::CreateToastNotifier()->Show(notification);
        
        	deferral->Complete();
        }
        
  12. Kota Iguchi 2016-04-20

    I think PR 635 will be not included in the tonight's nightly build. I have some more things to do for it. maybe ready tomorrow's build.
  13. Jörgen Buder 2016-04-20

    Ok got it, thanks, let me know when it is :)
  14. Kota Iguchi 2016-04-24

    This PR is already merged in master and should be ready in the current nightly build.
  15. Jörgen Buder 2016-05-12

    Hi I noted the callback native handler you added to support push notifications a while back, and I have had not time to test it, but carting a module with the latest SDK 20160511 there is no extension in the manifest that corresponds to a hook in the module? You specified it like this: similar to this that DO exist: Any idea why, can we use "any" function? Do we not need to use a hook similar to the time trigger? Or is this something I can add my self without further work on the module structure??
  16. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source