From 50fa70e3fa85f1c279a9a5d53c3a8f7650747056 Mon Sep 17 00:00:00 2001 From: Dhemy Date: Tue, 5 Nov 2024 20:04:50 +0100 Subject: [PATCH] Update test-notifications.mdx (#103) --- .../test-notifications.mdx | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/server-notifications/test-notifications.mdx b/docs/server-notifications/test-notifications.mdx index 62d06fc..051140c 100644 --- a/docs/server-notifications/test-notifications.mdx +++ b/docs/server-notifications/test-notifications.mdx @@ -4,3 +4,49 @@ description: "How to request and handle test notifications." --- # Test Notifications + +Both Google Play and App Store provide a way to test the server notifications, so you can verify that your server is +correctly set up to receive and handle the notifications. + +## Google Play + +After configuring the [Google Play RTDN](https://developer.android.com/google/play/billing/getting-ready#configure-rtdn), +and deploying your server with LIAP package enabled, You can test your configuration by using the **Send Test Message** +in the Google Play Console. If you have not configured a backend server to consume notifications, you can use the gcloud +command line tool to verify the configuration. For instructions on processing messages using gcloud, [see Pull the message +from the subscription](https://cloud.google.com/pubsub/docs/publish-receive-messages-console#pull_the_message_from_the_subscription). + +LIAP will automatically handle the test notifications and add a log entry similar to the following: + +```shell +Google Play Test Notification, version: 1.0 +``` + +## App Store + +To check the status of the test App Store server notification sent to your server. You can use the folloiwing command: + +```shell +php artisan liap:apple:test-notification +``` + +If you are testing on "sandbox" environment, you need to pass the `--sandbox` option: + +```shell +php artisan liap:apple:test-notification --sandbox +``` + +The command will request a test notification and will show you the notification token. + +LIAP will automatically handle the test notifications and add a log entry similar to the following: + +If you are using Notifications `v1`: +```shell +AppStore Test Notification +``` + +If you are using Notifications `v2`: + +```shell +AppStoreV2NotificationHandler: Test notification received +```