@readyio/react-native-wallet 0.1.38 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -49,6 +49,7 @@ yarn add @readyio/react-native-wallet
49
49
  "react-native": "*",
50
50
  "react-native-biometrics": "^3.0.1",
51
51
  "react-native-camera": "^3.18.0",
52
+ "react-native-collapsible-tab-view": "^8.0.0",
52
53
  "react-native-countdown-circle-timer": "^3.2.1",
53
54
  "react-native-get-random-values": "^1.10.0",
54
55
  "react-native-device-info": "^5.5.3",
@@ -335,13 +336,11 @@ To handle deep links for using **WalletConnect** to connect with a **DApp** in M
335
336
 
336
337
  ### Register for Firebase Cloud Messaging with Ready
337
338
 
338
- Set up Ready miniapp push notification server by registering a Firebase Cloud Messaging API server key for Ready Team.
339
-
340
- ![Firebase Server Key](./assets/firebase.png)
339
+ Please contact Ready team to set up push notification key on server side
341
340
 
342
341
  ### Config in client
343
342
 
344
- An example of setting up ready push notification using `@react-native-firebase/messaging`
343
+ #### An example of setting up ready push notification using `@react-native-firebase/messaging`
345
344
 
346
345
  1. Setup device token
347
346
  ```js
@@ -364,20 +363,57 @@ An example of setting up ready push notification using `@react-native-firebase/m
364
363
 
365
364
  // Forground handler
366
365
  messaging().onMessage((message: FirebaseMessagingTypes.RemoteMessage) => {
367
- if (ready.isReadyPush(message)) return
366
+ if (ready.isReadyPush(message.data)) return
368
367
 
369
368
  // Handle non-ready message
370
369
  })
371
370
 
372
371
  // Background handler
373
372
  messaging().setBackgroundMessageHandler(async (message: FirebaseMessagingTypes.RemoteMessage) => {
374
- if (ready.isReadyPush(message)) return
373
+ if (ready.isReadyPush(message.data)) return
375
374
 
376
375
  // Handle non-ready message
377
376
  })
378
377
 
379
378
  ```
380
379
 
380
+ #### An example of setting up ready push notification using `react-native-onesignal`
381
+
382
+ 1. Init appid and add listener event
383
+ ```js
384
+ import { LogLevel, OneSignal } from 'react-native-onesignal'
385
+
386
+ useEffect(() => {
387
+ // Remove this method to stop OneSignal Debugging
388
+ OneSignal.Debug.setLogLevel(LogLevel.Verbose)
389
+
390
+ // OneSignal Initialization
391
+ OneSignal.initialize('OneSignal App ID')
392
+
393
+ OneSignal.login('externalId')
394
+ // requestPermission will show the native iOS or Android notification permission prompt.
395
+ // We recommend removing the following code and instead using an In-App Message to prompt for notification permission
396
+ OneSignal.Notifications.requestPermission(true)
397
+
398
+ // Method for listening for notification clicks
399
+ OneSignal.Notifications.addEventListener('click', (event) => {
400
+ if (ready.isReadyPush(event.notification.additionalData)) {
401
+ console.log('Ready Push: clicked:', event.notification.additionalData)
402
+ return
403
+ }
404
+ // Handle non-ready event
405
+ })
406
+
407
+ OneSignal.Notifications.addEventListener('foregroundWillDisplay', (event) => {
408
+ if (ready.isReadyPush(event.notification.additionalData)) {
409
+ console.log('Ready Push: foregroundWillDisplay:', event.notification.additionalData)
410
+ return
411
+ }
412
+ // Handle non-ready event
413
+ })
414
+ }, [])
415
+
416
+ ```
381
417
 
382
418
  ## Supported Versions
383
419
 
@@ -90,6 +90,8 @@ dependencies {
90
90
  implementation 'org.whispersystems:curve25519-android:0.2.5'
91
91
  implementation ('org.web3j:core:4.8.7-android')
92
92
  implementation "androidx.constraintlayout:constraintlayout:2.1.3"
93
+ implementation 'com.google.mlkit:barcode-scanning:16.2.0'
94
+ implementation 'com.google.zxing:core:3.4.1'
93
95
 
94
96
  implementation project(path: ':react-native-randombytes')
95
97
  implementation project(path: ':react-native-gesture-handler')