It's a regular custom token to test.
[TonyTestToken:TTT:003537ec76f01108262864aaa417f521f26031d172f5bc54f5e3af4d9df7bc73:8b690d38]
It's a custom NFT token to test.
[TestNft:TN1:0025dadebe337a79006f181c05e4799ce98639aedfbd26335806790bdea4b1d4:c59a30f8]
It's a second custom NFT token to test.
[TestNftTest:TNT:00bf95e4edcebb2e9308e5e177d3562b9595844d5b2d42e0a389eb4eb2300644:ad8b0686]
-
Preparation
- Clear the application storage
- Make sure the deviceId is not registered in the unleash
push-notification.rollout
feature toggle - If testing the fullnode wallet, make sure the unleash wallet-service feature toggle is disabled
-
Initialize a new wallet
- You should not see a modal to opt-in the push notification yet
- Go to the Settings page
- You should not see the Push Notification item yet
-
Turn on the
push-notification
feature toggle- Go to the settings page
- Get the
deviceId
and add it in theUserIDs
for the stage and platform mobile in the unleashpush-notification.rollout
feature toggle. - Close the app and open again.
- The Push Notification item now shows up in the Settings page
-
Turn off the
push-notification
feature toggle- Go to the Settings page
- Remove your
deviceId
from the unleashpush-notification.rollout
feature toggle - Wait until the Push Notification item disappears from the Settings page
-
Test push notification settings on/off
- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
- Turn on the
Show amounts on notification
- Turn off the
Enable Push Notification
- Try to turn on the
Show amounts on notification
- it should not be possible
- Turn on the
Enable Push Notification
Show amounts on notification
should be on
- Turn off the
Show amounts on notification
- Turn off the
Enable Push Notification
- Turn on the
-
Try to send a notification with
push-notification
feature toggle turned off- Go to the Settings page
- Turn off the
push-notification
feature toggle - Send HTR to this wallet
- Wait some minutes to guarantee you won't receive any notifications for this tx
-
Try to send a notification with
push-notification
feature toggle turned on- Go to the Settings page
- Turn on the
push-notification
feature toggle - Send HTR to this wallet
- Wait some minutes to guarantee you won't receive any notifications for this tx (because the settings
Enable Push Notification
is disabled)
- Wait some minutes to guarantee you won't receive any notifications for this tx (because the settings
-
Send a token after turn on
Enable Push Notification
option- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Send HTR to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction without show amounts
There is a new transaction in your wallet.
- Dismiss the notification
- Turn on the
-
Send a token after turn on
Show amounts on notification
option- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Turn on the
Show amounts on notification
option - Send HTR to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction showing amounts in the message
You have received 0.04 HTR on a new transaction.
- Dismiss the notification
- Turn on the
-
View the details of the transaction (foreground)
- Send a token after turn on
Enable Push Notification
option - Keep the application open
- Click on the notification
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple)
- The
- Click on the
HTR - HATHOR
item- The Balance page should open
- Send a token after turn on
-
View the details of the transaction (quit)
[!NOTE] Notifee v5.7.0 with Android API 32 has a known issue regarding onBackgroundEvent.
- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Close the application
- Send HTR to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction without show amounts
There is a new transaction in your wallet.
- Click on the notification, open the app with your PIN
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple)
- The
- Click on the
HTR - HATHOR
item- The Balance page should open
- Turn on the
-
View the details of the transaction while in foreground starting from lock screen
- Send a token after turn on
Enable Push Notification
option - Keep the application open
- Go to the Settings screen.
- Go to Security
- Click on Lock Wallet.
- Click on the notification
- Unlock the screen
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple)
- The
- Click on the
HTR - HATHOR
item- The Balance page should open
- Send a token after turn on
-
Reset wallet and send a token
- Reset the wallet
- Send HTR to this wallet
- Wait until the notification arrives
- You should not receive a notification
- Import the wallet
- Send HTR to this wallet
- Wait until the notification arrives
- You should not receive a notification
- Send a token after turn on
Enable Push Notification
option- Wait until the notification arrives
- You should receive a notification of new transaction without show amounts
There is a new transaction in your wallet.
- Dismiss the notification
-
Send 2 tokens after turn on
Show amounts on notification
option- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Turn on the
Show amounts on notification
option - Send HTR and TTT to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction showing 2 amounts in the message
You have received 0.09 HTR and 0.01 TTT on a new transaction.
- Click on the notification
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple) - The
TTT - Test Token Test
name should be in gray
- The
- Click on the
TTT - Test Token Test
item- Nothing should happen
- Click on the
HTR - HATHOR
item- The Balance page should open
- Turn on the
-
Send 3 tokens after turn on
Show amounts on notification
option- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Turn on the
Show amounts on notification
option - Send HTR, TTT and TN1 to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction showing 2 amounts in the message
You have received 0.05 TN1, 0.03 TTT and 1 other token on a new transaction.
- Click on the notification
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple) - The
TTT - Test Token Test
name should be in gray - The
TN1 - Test Nft
name should be in gray
- The
- Click on the
TTT - Test Token Test
item- Nothing should happen
- Click on the
TN1 - Test Nft
item- Nothing should happen
- Click on the
HTR - HATHOR
item- The Balance page should open
- Turn on the
-
Send 4 tokens after turn on
Show amounts on notification
option- Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Turn on the
Show amounts on notification
option - Send HTR, TTT, TN1 and TNT to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction showing 2 amounts in the message
You have received 0.08 TNT, 0.05 TN1 and 2 other tokens on a new transaction.
- Click on the notification
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple) - The
TTT - Test Token Test
name should be in gray - The
TN1 - Test Nft
name should be in gray - The
TNT - Test Nft Test
name should be in gray
- The
- Click on the
TTT - Test Token Test
item- Nothing should happen
- Click on the
TN1 - Test Nft
item- Nothing should happen
- Click on the
TNT - Test Nft Test
item- Nothing should happen
- Click on the
HTR - HATHOR
item- The Balance page should open
- Turn on the
-
Register
TTT
token and send 2 tokens after turn onShow amounts on notification
option[!WARNING] Not possible using
wallet-service
intestnet
due to a validation that consults the fullnode. Jump to Test open the wallet 2 weeks later- Register
TTT
token in the wallet - Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Turn on the
Show amounts on notification
option - Send HTR and TTT to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction showing 2 amounts in the message
You have received 0.02 TTT and 0.01 HTR on a new transaction.
- Click on the notification
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple) - The
TTT - Test Token Test
name should be in the primary color (purple)
- The
- Click on the
TTT - Test Token Test
item- The Balance page for
TTT
token should open
- The Balance page for
- Register
-
Register
TN1
token and send 2 tokens after turn onShow amounts on notification
option- Register
TTT
token in the wallet - Turn on the
push-notification
feature toggle - Go to the Push Notification page
- Turn on the
Enable Push Notification
option - Turn on the
Show amounts on notification
option - Send HTR and TN1 to this wallet
- Wait until the notification arrives
- You should receive a notification of new transaction showing 2 amounts in the message
You have received 0.03 TN1 and 0.02 HTR on a new transaction.
- Click on the notification
- Wait until the modal with tx details open
- The
HTR - HATHOR
name should be in the primary color (purple) - The
TN1 - Test Nft
name should be in the primary color (purple) - The
TN1 - Test Nft
amount should be integer
- The
- Click on the
TN1 - Test Nft
item- The Balance page for
TN1
token should open
- The Balance page for
- Register
-
Send token to self
- Wait some minutes to guarantee you won't receive any notifications for this tx
-
Test open the wallet 2 weeks later
[!WARNING] Skip if running the wallet from store.
- Open the file
src/sagas/pushNotification.js
and search for the following assignment:const timeSinceLastRegistration = moment().diff(enabledAt, 'weeks');
- Assign the value
2
totimeSinceLastRegistration
and saveconst timeSinceLastRegistration = 2;
- Reload the wallet
- You should see a modal asking for a registration refresh
This modal only shows up when the user is using the fullnode wallet.
- Click on Refresh
- Enter your pin
- Done! You will continue to receive the push notification.
- Reassign
timeSinceLastRegistration
with its previous expression:const timeSinceLastRegistration = moment().diff(enabledAt, 'weeks');
- Open the file
-
Close test
- Register TNT token
- Send back all the tokens to the source wallet
- Disable push notification settings
- Turn off push notification feature toggle
- Unregister the tokens
- Reset the wallet
- Close the app
- Clear the application storage
- Get the
deviceId
and add it in theUserIDs
strategy in the unleashwallet-service-mobile-android-testnet.rollout
feature toggle - Turn the feature toggle on
Run all the tests above with the wallet-service turned on. But as a quick test you can run the following test:
- Send token after turn on the
wallet-service
feature toggle- Turn on the
push-notification
feature toggle - Turn on the
wallet-service
feature toggle - View the details of the transaction (foreground)
- View the details of the transaction (quit)
- Turn on the