Understanding Local Notification in Codename one - codenameone

I implemented a local notification test per this example https://www.codenameone.com/blog/local-notifications.html
I have the following two questions:
1) can I test local notifications from CN1 simulator. In the link above, I see a local notification test screenshot using the iPhone 6 simulator. Is there a way to force the app to run in background form the simulator in CN1?
2) If a local notification is sent when the app is running in foreground, I understand that the notification will not fire. Is the message lost in this case or is it queued somewhere?

Currently you can only test this on the device, it will work in the native simulator for iOS as you saw in the screeshot. You can run on the native iOS simulator using a Mac and include source.
The message would be lost if you fire in the foreground on iOS as it's the assumption that this is something you can notify within your app more effectively. You can determine if your app is in the foreground using the Display.isMinimized() method. In the foreground case you can use a tool like ToastBar to show a notification.

Related

react pwa firebase notification not working in android

i'm using firebase for my react PWA push notification , I've got everything setup for web app firebase push notification. when I try requesting a notification to desktop it works perfectly but on android devices when I send notification, event hough Postman gives success and message ID and etc but nothing shows on the screen neither in use, nor in background.
Not saying this is the answer in your case but, I had the same problem (notifications worked on desktop and IOS devices but not on Android). My problem was that I had notifications turned off. On your Android phone or tablet, open the Chrome app and try this.
To the right of the address bar, tap More. Settings. List item
Tap SiteSettings. Notifications.
At the top, turn the setting on or off.

How to get notifications when app is in close mode?

Notifications are currently displaying when the installed app is opened or minimized. Can we display this notifications when app is in close mode.
Do I need any configurations or code changes required to handle this requirement?
Background notifications work when the app is closed and minimized, that is their purpose. Make sure you followed the instructions in the developer guide when setting them up.

How to keep iOS native call UI after answering the call with CallKit

I am trying to achieve same results that can be seen on 29:52 second of Enhancing VoIP Apps with CallKit - WWDC 2016.
In that video it shows that after answering call the buttons are moved and changed by animation, and the screen stays in native in-call UI.
I built the Speakerbox and tried the "Simulate Incoming Call" function, but as soon as the call is answered by answer call button (the same action that is shown on video), the native call screen disappears and the application screen is shown with active calls shown in the list (which is different from what is shown in WWDC video):
Though there is a native call UI screen for very short time during transition from Incoming Call native UI to the app, but I can't find how to force it to stay on that screen.
Debugging the Speakerbox app there is no any delegate method called until all native screens are disappeared and the app is already opened.
I have tested receiving incoming call when the screen is locked, in that case the native UI is shown:
I would like to achieve same result on non locked phone.
Simply you can't keep native UI after accept incoming call, at least in iOS 10, maybe in iOS 11 Apple give a way to keep native UI.
If you lock the phone and then receive an incoming call, you will have similar experience to what you saw on WWDC. There is no a way to change this behavior in iOS 10.

How to play an alarm in WatchOS 2 when NSTimer is asleep?

Have a specialized timer I'm creating and have the NSTimer working fine, updating on wake, etc but can only get the haptic to play if the user has the app actually on the display. I realize there are no background apps, but looking at various ways to schedule the alert much like the native Timer app does for its simple timer.
NSTimer.ScheduledTimerWithTimeInterval does not fire if asleep, looking at local notifications (note this app needs to run without the iPhone present so unclear if this is possible) and perhaps presentAlertControllerWithTitle is the way to go but unclear how to schedule it.
This seems like a simple/typical ask but most of the timer tutorials online and the searching I've done ignore the fact the app goes to sleep or only handles the wake events to reset the timer appropriately.
With WatchOS 3.0 you can schedule UNNotificationRequest with a specified timeInterval to get notified that time out happened.
In watchOS 2 the only situation where your app will be launched in the background is when updating a complication. watchOS 2 doesn't offer any background modes.
watchOS 3 in the other hand extends background capabilities via Background App Refreshes (BAR) and if you're a Health&Fitness or a Mindfulness app you can start a workout session using HealthKit to continuously run on the background while your workout session is active.
Other then that the only way to accomplish what you need is via notifications. In watchOS 2 you need to use the WatchConnectivity framework to wake up your iOS app and schedule a notification on the phone (later on it will be routed to the watch if the phone is locked and the watch is being worn) or in watchOS 3 you can schedule local notifications that will only be presented on the watch via the UserNotifications.framework.
For more info, please check:
What's New in watchOS 3 (video)
Introduction to Notifications (video)
Watch Connectivity API reference
HKWorkoutSession API
UNNotifications API reference

Win 8.1 Universal app - App Exit on Fast App Switching

I am developing an app for Windows Universal 8.1, facing an issue where the App gets Exit on going background. The scenarios are as follows
When the app goes background on clicking Windows key(FAS), the app get exit.
When I launch Share Task i.e Data Transfer Manager Interface, after completing the share operation the app exit.
Works fine in Debug mode but issue found after deploying to the device.
PS : I am using the Navigation Service Interface to navigate to pages using MVVM and navigating from viewmodels.
Please help if its known issue, if not help to rectify this.
Thanks in advance.
Sounds like your App crashes in The Suspending Event. As apps in Debug mode are not suspended, you are unlikely to see that happen.
You can manually fire the event from Visual Studio when debugging: It is in the debugging toolbar under Application Lifecycle Events.
Most common error in this case: Using complex objects as navigation parameters, which cannot be serialized.

Resources