My issue is that I am testing with an iPhone and an iPad, and my iPad is receiving just fine, but my iPhone receives when the app is first installed, and then stops working. I've also seen the reverse, where the ipad stops and the phone works great. Running ios 15.3.1, but not unique to this release. I am using Microsoft Notification Hub to aggregate and push to devices. registrations are properly in the hub and verified through test send. Also using a separate tool to test directly sending to my ios devices using the token I receive from Apple. This tests out just fine as well. I believe that the call to DidReceivedRemoteNotification isn't being called all of the time, but there is no rhyme or reason. The behavior changes in test, when I have the debugger attached and I point my app to the test hub. So it's very difficult to reproduce in a way that I can understand what's happening. Looking for some suggestions on how to diagnose, or why might the method not be called sometimes, on a given device. Thanks in advance.
Ok, so I have things working correctly now. For the benefit of those who are looking at the same issues, and especially those who are inexperienced at ios apps, here goes...
I was using DidReeiveRemoteNotification for both the foreground and background pushes. This seemed to work most of the time, especially in foreground, but not always. In background, it was touch and go. I captured a sysdiagnose log and looked at the push as it was logged from the device, and saw that it was blocked by the OS, because it had too many apps running in the background. It is not guaranteed to wake up your app, and I was relying on it.
So instead, I implemented WillPresentNotification in my appdelegate to deal with foreground pushes, and it works very reliably. For background, all I needed to do was update the app badge and send an alert to the device, and that can be done without waking up the application - the os does it for you. Then, when the app gets woken back up to the foreground, I do a final update to my data so it matches with the badge. Hope this is of use to others.
Related
I think I know the answer to this question from my experiments, but I haven't been able to find a definitive answer when doing research.
Is is possible to send notifications to a PWA when it is opened in Chrome on mobile, but isn't installed?
Once it is installed I can receive notifications, but I can't before.
I'm having a hard time getting remote debugging working for my mobile so it's difficult to tell if the push event is even firing.
The docs, don't specify the need to install the pwa to be able to use the notification feature. However what I suspect is happening in your case is that Chrome is not giving priority to notify to the notification that you are sending without installing. What I mean is that you might receive your notification on the regular wakeup cycle of Chrome, and not as a background task. (But this is just a speculation)
Another common scenario that happens a lot, trust me :-), is that you forgot to give permission to send notifications in the first place.
Regarding remote debugging, refer the docs, to get it setup on Android. As a lot of the online tutorials are a bit out of date.
Note: I found an article online that shows a notification received without installing on Android, here is its link, it might not be very helpful for your case but check it out you might figure something out.
Yes they can.
The problem was that I had notifications enabled for my site, but disabled for Chrome itself.
I m using Device.BeginInvokeOnMainThread(() => { Thread.CurrentThread.Abort(); });
System.Diagnostics.Process.GetCurrentProcess().Kill(); this in xamarin.forms to kill app in ios through dependency service.
But actually it is not killing the app when i press the home button it is still showing.
Can anyone help me out of this?
This is not possible. From the Apple technical Q&A (https://developer.apple.com/library/archive/qa/qa1561/_index.html):
A: There is no API provided for gracefully terminating an iOS
application.
In iOS, the user presses the Home button to close applications. Should
your application have conditions in which it cannot provide its
intended function, the recommended approach is to display an alert for
the user that indicates the nature of the problem and possible actions
the user could take — turning on WiFi, enabling Location Services,
etc. Allow the user to terminate the application at their own
discretion.
Although the documentation is pretty old, this still stands. Even if you do find some way to implement it, it will never be allowed to the App Store.
Can anyone please so let me know precisely that how can I accomplish the task in which I need to show Push Notification to user when App is Quit/closed?
Currently, I am able to get the push notification done when App is running in background or opened. But App couldn't receive Notification when it is quit/closed by the user.
Right now, it's a really critical task on my shoulders. It's pretty clear do tell me in case if you guys need me to brief in details.
I am having a very hard time to believe that your scenario is Really the following:
When the app is either: open and in the foreground, or open and in the background, you are able to receive a notification to the device, and have its contents displayed in the app, but
When the app is quit (as in not running), the notification does not arrive to the device at all.
I have tested several devices and several push-enabled applications (event source, tag-based). The notification does arrive to the device, after the user subscribed to either a tag or by logging-in (in the case of event source-based), after which sending a notification always arrived to the device.
I don't understand this sentence:
my app logouts with the user
You need to be CLEAR in your explanation. Is there a logout button that the user clicks? If yes, are you also for some reason perform an unsubscribe API invocation? If no, edit the question and provide DETAILED, step-by-step reproduction instructions, AS WELL as provide your application, or any code that you use so that it could be inspected for possible issues.
When an online client (a desktop) and an offline client (a phone) both enter data, and the phone is brought back online, the phone does not receive the data posted on the desktop during the offline period.
To duplicate, in an empty directory, run firebase bootstrap, enter the name of your app, and choose the react template. Then do firebase deploy and firebase open to visit the page in the desktop browser. Then visit the same page in the phone browser.
Begin entering data alternately in the React + Plain Firebase pane of the desktop and phone browsers. Enter '1' on the desktop, '2' on the phone, '3' on the desktop, etc. So far the series displays 1 2 3 on both browsers as expected. Then put the phone in airplane mode and continue entering numbers alternately. Now the desktop shows only the odd numbers that are being added, and the phone shows only the even. This is also expected.
Now bring the phone back online. The phone will push its data to firebase and the even numbers will show up on the desktop (although oddly in a different order in the React + Plain Firebase pane and the React + ReactFire pane).
But the odd numbers do not show up on the phone, until the app is reloaded. Is this expected? Is there a way to force a complete resync in when a client goes online?
UPDATE: Other questions I have seen on firebase offline usage have been about detecting presence, user auth or other more complicated scenarios. My case is simpler. The docs say:
Once connectivity is reestablished, we'll receive the appropriate set of events so that the client "catches up" with the current server state, without having to write any custom code.
To me, this means that syncing should "just work" without the necessity of the app "knowing" whether or not it is online or doing anything special when it goes online.
I was also assuming that firebase offline data storage is persistent, but Kato's recent comment to this question indicates that it is not. So I guess the answer is that Firebase's offline storage implementation is incomplete, and its limitations are not well documented.
Does anyone know of an AIR Native Extension (ANE) that allows you to access the device's notification sound(s)? OR, a method to query if the device is in "silent" or "vibrate" mode?
I've set up Push Notifications, but no sound plays on my (Android) device.
I know I can play my own sounds, but I want to use the native notification sound (the same as an SMS or email alert sound) and I don't want the sound to play if it shouldn't (viz. silent mode / vibrate mode).
I've been looking for hours and there's a "Vibrate ANE," and others looking for the same type of capability, but I haven't found anything usable for native sound notifications.
I believe that iOS automatically will play a notification sound when it receives a push notification (I think), but Android just flashes the "shade title" & shows the app's icon for the notification.
Maybe someone else has stumbled across a solution??? =)
Many Thanks!
Todd =D
I think you might have to be careful attempt to access the built in sounds on iOS.
We definitely could write an extension that played any of the system sounds. However I believe these sounds are copyrighted, and my understanding of the Apple ToS is that your application may get rejected from the AppStore if you use them directly.
This is why things like a notifications extension only use a "default notification" value to access system sounds that are set by the user. These sounds are played on certain system events.
The sounds are all accessed via undocumented IDs: http://iphonedevwiki.net/index.php/AudioServices
So yeah we’ve been very cautious of writing anything that could put developers in trouble with the AppStore. You have enough problems getting apps through as is. But if you read otherwise let me know.