Comments (8)
@K232 Before an Android app can receive push notifications, it must register with Firebase Cloud Messaging, which generates a registration token and returns it to the app. This is accomplished by:
- Declaring a receiver in the Android manifest.
- Implementing the Firebase Instance ID service (which is what the
FirebaseRegistrationService
class does).
When the app receives a registration token from Firebase, the FirebaseRegistrationService.OnTokenRefresh
method is invoked, which in turn invokes SendRegistrationTokenToAzureNotificationHub
, which in turn invokes AzureNotificationHubService.RegisterAsync
.
The fact that AzureNotificationHubService.RegisterAsync
is never called for you implies that the app isn't getting a token from Firebase, which implies either incorrect Firebase setup or the app not communicating with Firebase.
For more information about how to do this, see Sending Push Notifications from Azure Mobile Apps.
from azure-docs.
Thanks @K232, note that your emulator must be configured with Google Play Services (ie "a virtual device that has Google APIs set as the target"). The Play app should be present on the emulator - we'll make this more obvious in the doc.
We've identified this as a common cause of push notifications not working on emulators, since Google Play Services/Google APIs aren't automatically present in every emulator configuration (especially when it works fine on real hardware). You can read more about emulator configuration on the Xamarin site:
from azure-docs.
@K232 Also, I've fixed the deprecated SetSound API. However, I've no problems with Resource.Drawable.ic_stat_ic_notification. If it wasn't in the project, the app wouldn't build.
from azure-docs.
The doc and sample have been updated with the feedback from this conversation #please-close
from azure-docs.
Hmm, seems to be a problem of my emulator because on Hardware it works :-)
But nothing is displayed. Application output says:
[FirebaseNotificationService] Notification message body: Notification Hub test notification
[sfx] Unknown style!!! : com.android.internal.util.NotificationColorUtil@b5a3a2e
Downloaded demo app also has warnings on new Notification.Builder because SetSound is deprecated and Resource.Drawable.ic_stat_ic_notification is not found.
Any updates available?
from azure-docs.
Thanx for the feedback!
I have assigned this to the author to take a look if there are any issues with the steps in the document. Stay tuned :)
from azure-docs.
@K232 can you provide the link you used to download the demo app? Thanks!
from azure-docs.
Hi @conceptdev , it's from https://developer.xamarin.com/samples/xamarin-forms/WebServices/TodoAzurePush/ .
from azure-docs.
Related Issues (20)
- Preprocessing Before Embedding HOT 1
- Authentication headers reference? HOT 1
- how do I know if I am using avd Classic? HOT 2
- Add example of token expiration to Entra authentication example HOT 1
- Resizing disks for Red Hat - recommended methods of growing filesystems. HOT 1
- Does Microsoft.Graph.UserCreated event type exist? HOT 2
- Event types for Microsoft Graph messages HOT 3
- Event type for removed driveItem HOT 2
- Missing event types for Graph API resources HOT 3
- Text to Speech Avatar in Teams bot HOT 1
- TCP Example in this article - Still not possible or oversight? HOT 1
- Azure portal: App settings and Connection strings are now not under Configuration menu item. HOT 1
- 2 issues detected with VS Code working with Std Logic App Workspace HOT 1
- Migration to FCM V1 issues - how to migrate (update) existing installations to FCM V1? HOT 1
- Azure App Service AppServiceHTTPLogs do not contain cookie information HOT 1
- Either the Dataverse Inline Sink for lookups with alternative keys doesn't work or the documentation is wrong HOT 1
- remove annotation kubernetes.io/ingress.class: nginx HOT 3
- Broken link - security settings HOT 1
- Mismatching content: Title and the content don't match HOT 1
- Trusted Signing identity validation failed - no way forward? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-docs.