Skip to content

Commit bb0c200

Browse files
committed
Merge branch 'loren/embedded/MOB-12265-start-end-session' into loren/embedded/MOB-12264-android-sync-and-get-messages
2 parents 94e46a6 + bab2b35 commit bb0c200

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4088
-499
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ module.exports = {
4848
},
4949
},
5050
],
51+
ignorePatterns: ['coverage/**/*', 'lib/**/*', 'docs/**/*'],
5152
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ ios/generated
8585
android/generated
8686

8787
# Iterable
88+
.env.local
8889
.env
8990
.xcode.env.local
9091
coverage/

CHANGELOG.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,50 @@
1-
## 2.1.0-beta.1
1+
## 2.2.0-alpha.1
22

3-
## Fixes
4-
- Add Temporary fix for circular paths, which break expo ([9c09743](https://github.com/Iterable/react-native-sdk/commit/9c09743))
3+
### Updates
4+
* [SDK-149] Added logout functionality
5+
6+
### Fixes
7+
* [SDK-151] Fixed "cannot read property authtoken of undefined" error
8+
9+
10+
## 2.2.0-alpha.0
11+
12+
### Updates
13+
- Updated Android SDK version to [3.6.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.6.2)
14+
- Updated iOS SDK version to [6.6.3](https://github.com/Iterable/swift-sdk/releases/tag/6.6.3)
15+
- Added JWT Capabilities:
16+
- Added `Iterable.authhManager`, which manages the authentication flow
17+
- Added `IterableRetryBackoff` and `IterableAuthFailureReason` enums
18+
- Added `onJwtError` and `retryPolicy` for control over JWT flow
19+
- Moved all native calls to `IterableApi.ts`
20+
- Added JWT example to our example app
521

6-
## 2.1.0-beta.0
22+
### Fixes
23+
- Created a standalone `IterableLogger` to avoid circular dependencies
724

25+
## 2.1.0
826
### Updates
27+
* SDK is now compatible with both New Architecture and Legacy Architecture. Fix
28+
for #691, #602, #563.
29+
30+
### Fixes
31+
- Dependencies update
932
- Update SDK so that it has full support for [React Native New Architecture](https://reactnative.dev/architecture/landing-page)
33+
- Add Temporary fix for circular paths, which break expo ([9c09743](https://github.com/Iterable/react-native-sdk/commit/9c09743))
1034

1135
### Chores
1236
- Update dependencies for React Navigation and related packages ([95053bb](https://github.com/Iterable/react-native-sdk/commit/95053bb))
1337

38+
## 2.0.4
39+
40+
### Updates
41+
- Added API documentation via Netlify([1087275](https://github.com/Iterable/react-native-sdk/commit/1087275))
42+
- Removed dependency on `react-native-vector-icons`, per issues
43+
[#513](https://github.com/Iterable/react-native-sdk/issues/513),
44+
[#683](https://github.com/Iterable/react-native-sdk/issues/683) and
45+
[#675](https://github.com/Iterable/react-native-sdk/issues/675)
46+
([6ece6e0](https://github.com/Iterable/react-native-sdk/commit/6ece6e0))
47+
- Updated dependencies
1448

1549
## 2.0.3
1650

Iterable-React-Native-SDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
1717
s.private_header_files = "ios/**/*.h"
1818

1919
# Load Iterables iOS SDK as a dependency
20-
s.dependency "Iterable-iOS-SDK", "6.6.1"
20+
s.dependency "Iterable-iOS-SDK", "6.6.3"
2121

2222
# Basic Swift support
2323
s.pod_target_xcconfig = {

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Iterable's React Native SDK relies on:
4444
_UI Components require additional peer dependencies_
4545
- [React Navigation 6+](https://github.com/react-navigation/react-navigation)
4646
- [React Native Safe Area Context 4+](https://github.com/th3rdwave/react-native-safe-area-context)
47-
- [React Native Vector Icons 10+](https://github.com/oblador/react-native-vector-icons)
4847
- [React Native WebView 13+](https://github.com/react-native-webview/react-native-webview)
4948

5049
- **iOS**
@@ -120,13 +119,13 @@ For quick reference, the following table lists the versions of the [Android SDK]
120119
121120
| RN SDK Version | Android SDK Version | iOS SDK Version |
122121
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------- |
123-
| [2.1.0-beta.0](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.1.0-beta.0) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
122+
| [2.2.0](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.2.0) | [3.6.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.6.2) | [6.6.3](https://github.com/Iterable/swift-sdk/releases/tag/6.6.3)
123+
| [2.1.0](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.1.0) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
124+
| [2.0.4](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.4) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
124125
| [2.0.3](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.3) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
125126
| [2.0.2](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.2) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
126127
| [2.0.1](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.1) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
127128
| [2.0.0](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.0) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
128-
| [2.0.0-beta.1](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.0-beta.1) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
129-
| [2.0.0-beta](https://www.npmjs.com/package/@iterable/react-native-sdk/v/2.0.0-beta) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
130129
| [1.3.21](https://www.npmjs.com/package/@iterable/react-native-sdk/v/1.3.20) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
131130
| [1.3.20](https://www.npmjs.com/package/@iterable/react-native-sdk/v/1.3.20) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.4](https://github.com/Iterable/swift-sdk/releases/tag/6.5.4)
132131
| [1.3.19](https://www.npmjs.com/package/@iterable/react-native-sdk/v/1.3.19) | [3.5.2](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.5.2) | [6.5.3](https://github.com/Iterable/swift-sdk/releases/tag/6.5.3)

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
105105
dependencies {
106106
implementation "com.facebook.react:react-android"
107107
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
108-
api "com.iterable:iterableapi:3.6.1"
108+
api "com.iterable:iterableapi:3.6.2"
109109
// api project(":iterableapi") // links to local android SDK repo rather than by release
110110
}
111111

android/src/main/java/com/iterable/reactnative/RNIterableAPIModuleImpl.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
import com.iterable.iterableapi.IterableAuthHandler;
2929
import com.iterable.iterableapi.IterableConfig;
3030
import com.iterable.iterableapi.IterableCustomActionHandler;
31-
// import com.iterable.iterableapi.IterableEmbeddedManager;
3231
import com.iterable.iterableapi.IterableEmbeddedMessage;
33-
// import com.iterable.iterableapi.IterableEmbeddedSession;
34-
// import com.iterable.iterableapi.IterableEmbeddedUpdateHandler;
3532
import com.iterable.iterableapi.IterableHelper;
3633
import com.iterable.iterableapi.IterableInAppCloseAction;
3734
import com.iterable.iterableapi.IterableInAppHandler;
@@ -130,8 +127,8 @@ public void initialize2WithApiKey(String apiKey, ReadableMap configReadableMap,
130127
}
131128

132129
if (configReadableMap.hasKey("enableEmbeddedMessaging")) {
133-
configBuilder.setEnableEmbeddedMessaging(configReadableMap.getBoolean("enableEmbeddedMessaging"));
134-
}
130+
configBuilder.setEnableEmbeddedMessaging(configReadableMap.getBoolean("enableEmbeddedMessaging"));
131+
}
135132

136133
// NOTE: There does not seem to be a way to set the API endpoint
137134
// override in the Android SDK. Check with @Ayyanchira and @evantk91 to
@@ -616,11 +613,6 @@ public void onTokenRegistrationSuccessful(String authToken) {
616613
sendEvent(EventName.handleAuthSuccessCalled.name(), null);
617614
}
618615

619-
public void onTokenRegistrationFailed(Throwable object) {
620-
IterableLogger.v(TAG, "Failed to set authToken");
621-
sendEvent(EventName.handleAuthFailureCalled.name(), null);
622-
}
623-
624616
public void addListener(String eventName) {
625617
// Keep: Required for RN built in Event Emitter Calls.
626618
}

example/.env.example

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@
99
# 4. Fill in the following fields:
1010
# - Name: A descriptive name for the API key
1111
# - Type: Mobile
12-
# - JWT authentication: Leave **unchecked** (IMPORTANT)
12+
# - JWT authentication: Whether or not you want to use JWT
1313
# 5. Click "Create API Key"
14-
# 6. Copy the generated API key
15-
# 7. Replace the placeholder text next to `ITBL_API_KEY=` with the copied API key
14+
# 6. Copy the generated API key and replace the placeholder text next to
15+
# `ITBL_API_KEY=` with the copied API key
16+
# 7. If you chose to enable JWT authentication, copy the JWT secret and and
17+
# replace the placeholder text next to `ITBL_JWT_SECRET=` with the copied
18+
# JWT secret
1619
ITBL_API_KEY=replace_this_with_your_iterable_api_key
20+
# Your JWT Secret, created when making your API key (see above)
21+
ITBL_JWT_SECRET=replace_this_with_your_jwt_secret
22+
# Is your api token JWT Enabled?
23+
# Must be set to 'true' to enable JWT authentication
24+
ITBL_IS_JWT_ENABLED=true
1725

1826
# Your Iterable user ID or email address
19-
ITBL_ID=replace_this_with_your_user_id_or_email
27+
ITBL_ID=replace_this_with_your_user_id_or_email

example/README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ _example app directory_. To do so, run the following:
2323

2424
```bash
2525
cd ios
26-
pod install
26+
bundle install
27+
bundle exec pod install
2728
```
2829

2930
Once this is done, `cd` back into the _example app directory_:
@@ -40,12 +41,18 @@ In it, you will find:
4041

4142
```shell
4243
ITBL_API_KEY=replace_this_with_your_iterable_api_key
44+
ITBL_JWT_SECRET=replace_this_with_your_jwt_secret
45+
ITBL_IS_JWT_ENABLED=true
4346
ITBL_ID=replace_this_with_your_user_id_or_email
4447
```
4548

46-
Replace `replace_this_with_your_iterable_api_key` with your _mobile_ Iterable API key,
47-
and replace `replace_this_with_your_user_id_or_email` with the email or user id
48-
that you use to log into Iterable.
49+
- Replace `replace_this_with_your_iterable_api_key` with your **_mobile_
50+
Iterable API key**
51+
- Replace `replace_this_with_your_jwt_secret` with your **JWT Secret** (if you
52+
have a JWT-enabled API key)
53+
- Set `ITBL_IS_JWT_ENABLED` to true if you have a JWT-enabled key, and false if you do not.
54+
- Replace `replace_this_with_your_user_id_or_email` with the **email or user
55+
id** that you use to log into Iterable.
4956

5057
Follow the steps below if you do not have a mobile Iterable API key.
5158

@@ -54,12 +61,12 @@ To add an API key, do the following:
5461
1. Sign into your Iterable account
5562
2. Go to [Integrations > API Keys](https://app.iterable.com/settings/apiKeys)
5663
3. Click "New API Key" in the top right corner
57-
4. Fill in the followsing fields:
64+
4. Fill in the following fields:
5865
- Name: A descriptive name for the API key
5966
- Type: Mobile
60-
- JWT authentication: Leave **unchecked** (IMPORTANT)
67+
- JWT authentication: Check to enable JWT authentication. If enabled, will need to create a [JWT generator](https://support.iterable.com/hc/en-us/articles/360050801231-JWT-Enabled-API-Keys#sample-python-code-for-jwt-generation) to generate the JWT token.
6168
5. Click "Create API Key"
62-
6. Copy the generated API key
69+
6. Copy the generated API key and JWT secret into your _.env_ file
6370

6471

6572
## Step 3: Start the Metro Server

example/android/app/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,3 @@ dependencies {
117117
implementation jscFlavor
118118
}
119119
}
120-
121-
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")

0 commit comments

Comments
 (0)