Skip to content

Commit aa4f40d

Browse files
author
UnnatiCP
committed
Added getDeviceToken method in RN SDK
Added getDeviceToken method in RN SDK
1 parent 1d98b08 commit aa4f40d

5 files changed

Lines changed: 44 additions & 3 deletions

File tree

docs/sdks/android/methods.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,35 @@ class MainActivity:Activity() {
350350

351351
<!--END_DOCUSAURUS_CODE_TABS-->
352352

353+
## Get Device Token
354+
355+
You can retrieve the current device token (used for push notifications) with the following method:
356+
357+
<!--DOCUSAURUS_CODE_TABS-->
358+
359+
<!--Java-->
360+
361+
```java
362+
CleverPush.getInstance(this).getDeviceToken(new DeviceTokenListener() {
363+
@Override
364+
public void complete(String deviceToken) {
365+
System.out.println("Device Token: " + deviceToken);
366+
}
367+
});
368+
```
369+
370+
<!--Kotlin-->
371+
372+
```kotlin
373+
CleverPush.getInstance(this).getDeviceToken(object : DeviceTokenListener {
374+
override fun complete(deviceToken: String) {
375+
println("Device Token: $deviceToken")
376+
}
377+
})
378+
```
379+
380+
<!--END_DOCUSAURUS_CODE_TABS-->
381+
353382

354383
## Tags
355384

docs/sdks/android/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can find the newest sdk version number here [Android SDK](https://github.com
2121
```groovy
2222
dependencies {
2323
// ...
24-
implementation 'com.cleverpush:cleverpush:1.35.6'
24+
implementation 'com.cleverpush:cleverpush:1.35.8'
2525
}
2626
```
2727

docs/sdks/flutter/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Setup
88
1. Add the following code to your `pubspec.yaml` file
99
```bash
1010
dependencies:
11-
cleverpush_flutter: ^1.24.22
11+
cleverpush_flutter: ^1.24.23
1212
```
1313

1414
2. Run `flutter packages get`

docs/sdks/ios/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ title: Setup
1919
Add CleverPush to your Podfile:
2020

2121
```bash
22-
pod 'CleverPush', '~> 1.34.23'
22+
pod 'CleverPush', '~> 1.34.25'
2323
```
2424

2525
#### Swift Package Manager Setup

docs/sdks/react-native/methods.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,15 @@ If a banner would show during this time, it is added to an internal queue and sh
324324
CleverPush.disableAppBanners();
325325
CleverPush.enableAppBanners();
326326
```
327+
328+
## Get Device Token
329+
330+
(Available from version 1.7.20)
331+
332+
You can retrieve the current device token (used for push notifications) with the following method:
333+
334+
```javascript
335+
CleverPush.getDeviceToken((err, deviceToken) => {
336+
console.log('Device Token:', deviceToken);
337+
});
338+
```

0 commit comments

Comments
 (0)