Skip to content

Commit

Permalink
Merge pull request #13 from Countly/deviceIDType
Browse files Browse the repository at this point in the history
added temporary device id type to init
  • Loading branch information
ArtursKadikis authored Apr 26, 2023
2 parents e7a77e6 + f519686 commit 6da0b36
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 357 deletions.
6 changes: 6 additions & 0 deletions CountlyRNExample/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class Example extends Component {
return;
}
const countlyConfig = new CountlyConfig(COUNTLY_SERVER_KEY, COUNTLY_APP_KEY)
// .setDeviceID(Countly.TemporaryDeviceIDString) // Enable temporary id mode
.setLoggingEnabled(true) // Enable countly internal debugging logs
.enableCrashReporting() // Enable crash reporting to report unhandled crashes to Countly
.setRequiresConsent(true) // Set that consent should be required for features to work.
Expand Down Expand Up @@ -369,6 +370,10 @@ class Example extends Component {
Countly.userData.pullValue('type', 'morning');
};

temporaryDeviceIdMode = () => {
Countly.changeDeviceId(Countly.TemporaryDeviceIDString);
};

changeDeviceId = () => {
Countly.changeDeviceId('02d56d66-6a39-482d-aff0-d14e4d5e5fda');
};
Expand Down Expand Up @@ -736,6 +741,7 @@ class Example extends Component {
<Text style={[{ textAlign: 'center' }]}>.</Text>
<Text style={[{ textAlign: 'center' }]}>Push Notification Start</Text>
<CountlyButton onPress={this.askForNotificationPermission} title="askForNotificationPermission" color="#00b5ad" />
<CountlyButton onPress={this.temporaryDeviceIdMode} title="Enter Temporary Device ID Mode" color="#00b5ad" />
<CountlyButton onPress={this.changeDeviceId} title="Change Device ID" color="#00b5ad" />
<Text style={[{ textAlign: 'center' }]}>Push Notification End</Text>
<Text style={[{ textAlign: 'center' }]}>.</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
Loading

0 comments on commit 6da0b36

Please sign in to comment.