…
|
||
---|---|---|
.. | ||
src/main | ||
.gitignore | ||
README.md | ||
build.gradle | ||
google-services.json | ||
proguard-rules.pro |
README.md
Test android app for Azure Communication Chat Service common functionality.
Setup:
- Open the whole repository in Android Studio.
- Click Gradle Sync.
- Open
sample-chat-app/src/main/java/com/azure/android/communication/chat/sampleapp/MainActivity
. - Replace the
firstUserId
andsecondUserId
with valid user identifiers. - Replace the
firstUserAccessToken
with an access token generated for the first user. - If you want to enable the FCM push notification feature, use the following instructions:
- Follow this link to create your own Firebase project, register this test app with Firebase, then download the Firebase config file "google-services.json" to replace the existing empty file with the same name under the "sample-chat-app" folder.
- Follow this link to create a Notification Hub under the same Azure Subscription as your ACS resource and link your Firebase project to this Notification Hub.
- Follow this link to link your ACS resource with your ACS resource.
- Run the "sample-chat-app" from the IDE by clicking the 'Run' button in the top right corner.
Functions:
-
Use the button 'Start Realtime Notifications', to start the realtime notifications.
-
Use the button 'Register Realtime Notifications listener' to register listeners for all events.
-
Use the button 'Unregister Realtime Notifications listener' to unregister listeners for all events.
-
Use the button 'Start Push Notifications', to start FCM push notifications.
-
Use the button 'Register Push Notifications listener' to register listeners for all FCM push notifications events.
-
Use the button 'Stop Push Notifications' to stop FCM push notifications.
After registering a listener for a specific type of event, you'll need to use Postman or a JS client to create a thread with the same token you used in the test app and then send a message to the thread. Observe logs and your app's UI to see if the test app receives realtime/push notifications.