Skip to content

Commit ce6ca0d

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/example/e2e/follow-redirects-and-appium-base-driver-1.15.6
2 parents 98d12f4 + b6f353e commit ce6ca0d

File tree

119 files changed

+75908
-9846
lines changed

Some content is hidden

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

119 files changed

+75908
-9846
lines changed

.circleci/config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ version: 2.1
33
# Default VM config to be used for macOS builds
44
macos_config: &macos_config
55
macos:
6-
xcode: 14.0.0
7-
resource_class: macos.x86.medium.gen2
6+
xcode: 15.3.0
7+
resource_class: macos.m1.large.gen1
88
shell: /bin/bash --login -eo pipefail
99

1010
setup_env_file: &setup_env_file
@@ -16,7 +16,7 @@ setup_env_file: &setup_env_file
1616
executors:
1717
default:
1818
docker:
19-
- image: circleci/node:14
19+
- image: cimg/node:22.2.0
2020
working_directory: ~/project
2121

2222
orbs:
@@ -53,6 +53,7 @@ jobs:
5353
- run:
5454
name: Install dependencies
5555
command: |
56+
corepack enable
5657
yarn install --cwd example
5758
yarn install --cwd example/e2e
5859
yarn install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ android/keystores/debug.keystore
6060
lib/
6161

6262
.env
63+
google-services.json

README.md

Lines changed: 136 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ ___
2626
- [Push Notifications](#ios-push-notifications)
2727
- [Push notification deep links support](#ios-push-notification-deep-links-support)
2828
- [Expo](#expo)
29-
- [Limitations](#limitations)
29+
- [Push Notifications](#expo-push-notifications)
30+
- [Push notification deep links support](#expo-push-notification-deep-links-support)
31+
- [Android](#android-deep-link)
32+
- [iOS](#ios-deep-link)
3033
- [Common methods](#methods)
3134
- [Types](#types)
3235
- [Usage](#usage)
@@ -278,10 +281,21 @@ public class MainNotificationService extends FirebaseMessagingService {
278281

279282
```
280283

281-
See the [example app](https://github.com/intercom/intercom-react-native/blob/main/example/src/App.tsx) for an example of how to handle deep linking in your app.
284+
Add the following in your `MainActivity`
285+
286+
```kotlin
287+
override fun onNewIntent(intent: Intent) {
288+
super.onNewIntent(intent)
289+
setIntent(intent)
290+
}
291+
```
292+
293+
See the [example app](https://github.com/intercom/intercom-react-native/blob/main/sandboxes/NotificationsSandbox/App.tsx) for an example of how to handle deep linking in your app.
282294

283295
### IOS
284296

297+
Intercom for iOS requires a **minimum iOS version of 15.**
298+
285299
```sh
286300
cd ios
287301
pod install
@@ -324,12 +338,15 @@ See [How to manually link IOS Intercom SDK](docs/IOS-MANUAL-LINKING.md)
324338
Add this permission to your `Info.plist`
325339
326340
```xml
327-
<key>NSPhotoLibraryUsageDescription</key>
328-
<string>Send photos to support center</string>
341+
<key>NSCameraUsageDescription</key>
342+
<string>Access your camera to take photos within a conversation</string>
329343
```
330344

331345
#### iOS: Push Notifications
332346

347+
>**Note**: You should request user permission to display push notifications.
348+
e.g. [react-native-permissions](https://github.com/zoontek/react-native-permissions)
349+
333350
Add **Push Notifications** and **Background Modes > Remote Notifications** [Details HERE](https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app)
334351

335352

@@ -468,11 +485,124 @@ The plugin provides props for extra customization. Every time you change the pro
468485
}
469486
```
470487

488+
#### Expo: Push notifications
489+
490+
Add the following configurations into your `app.json` or `app.config.js`:
491+
492+
Place your `google-services.json` inside the project's root and link it
493+
494+
```json
495+
{
496+
"expo": {
497+
...
498+
"android": {
499+
"googleServicesFile": "./google-services.json",
500+
...
501+
}
502+
}
503+
```
504+
505+
Add the necessary permission descriptions to infoPlist key.
506+
507+
```json
508+
{
509+
"expo": {
510+
...
511+
"ios": {
512+
...
513+
"infoPlist": {
514+
"NSCameraUsageDescription": "This is just a sample text to access the Camera",
515+
}
516+
...
517+
}
518+
}
519+
}
520+
```
521+
522+
>**Note**: You should request user permission to display push notifications.
523+
e.g. [react-native-permissions](https://github.com/zoontek/react-native-permissions)
524+
471525
Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.
472526

473-
#### Limitations
527+
#### Expo: Push notification deep links support
528+
529+
> **Note**: You can read more on Expo [documentation](https://docs.expo.dev/guides/deep-linking)
530+
531+
#### Android: Deep Link
532+
533+
```json
534+
{
535+
"expo": {
536+
"android": {
537+
"intentFilters": [
538+
{
539+
"action": "VIEW",
540+
"data": [
541+
{
542+
"host": "Your app scheme(app)"
543+
}
544+
],
545+
"category": ["BROWSABLE", "DEFAULT"]
546+
}
547+
]
548+
}
549+
}
550+
}
551+
```
552+
553+
#### Android: App Links
554+
555+
```json
556+
{
557+
"expo": {
558+
"android": {
559+
"intentFilters": [
560+
{
561+
"action": "VIEW",
562+
"autoVerify": true,
563+
"data": [
564+
{
565+
"scheme": "https",
566+
"host": "Your app url(www.app.com)",
567+
"pathPrefix": "Your url prefix e.g. /settings)"
568+
}
569+
],
570+
"category": ["BROWSABLE", "DEFAULT"]
571+
}
572+
]
573+
}
574+
}
575+
}
576+
```
577+
578+
#### iOS: Deep Link
579+
580+
```json
581+
{
582+
"expo": {
583+
"ios": {
584+
"infoPlist": {
585+
"LSApplicationQueriesSchemes": ["Your app scheme(app)"]
586+
}
587+
}
588+
}
589+
}
590+
```
591+
592+
#### iOS: Universal Link
593+
594+
```json
595+
{
596+
"expo": {
597+
"ios": {
598+
"infoPlist": {
599+
"IntercomUniversalLinkDomains": ["Your app url(www.app.com)"]
600+
}
601+
}
602+
}
603+
}
604+
```
474605

475-
- **No push notifications support**: Intercom push notifications currently aren't supported by this config plugin extension. This will be added in the future.
476606

477607

478608
## Methods

android/build.gradle

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
def packageJsonFile = file('../package.json')
2-
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3-
def packageVersion = '"' + packageJson.version + '"'
1+
def packageJsonFile = file('../package.json')
2+
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3+
def packageVersion = '"' + packageJson.version + '"'
44

55

66
buildscript {
7-
if (project == rootProject) {
8-
repositories {
9-
google()
10-
mavenCentral()
11-
}
7+
ext {
8+
buildToolsVersion = "34.0.0"
9+
minSdkVersion = 21
10+
compileSdkVersion = 34
11+
targetSdkVersion = 34
12+
ndkVersion = "25.1.8937393"
13+
kotlinVersion = "1.8.0"
14+
}
15+
if (project == rootProject) {
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
1220

13-
dependencies {
14-
classpath 'com.android.tools.build:gradle:3.5.3'
15-
}
21+
dependencies {
22+
classpath("com.android.tools.build:gradle")
23+
classpath("com.facebook.react:react-native-gradle-plugin")
24+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
1625
}
26+
}
1727
}
1828

1929
apply plugin: 'com.android.library'
2030

2131
def safeExtGet(prop, fallback) {
22-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
32+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2333
}
2434

2535
android {
26-
// Compatibility for AGP v. <4.2/Gradle 8
27-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
28-
if (agpVersion >= 7) {
29-
namespace 'com.intercom.reactnative'
30-
}
36+
namespace 'com.intercom.reactnative'
37+
compileSdk rootProject.ext.compileSdkVersion
38+
buildToolsVersion rootProject.ext.buildToolsVersion
3139

32-
compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 34)
33-
defaultConfig {
34-
minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21)
35-
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 34)
36-
versionCode 1
37-
versionName "1.0"
38-
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
39-
}
40+
defaultConfig {
41+
minSdkVersion rootProject.ext.minSdkVersion
42+
targetSdkVersion rootProject.ext.targetSdkVersion
43+
versionCode 1
44+
versionName "1.0"
45+
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
46+
}
4047

41-
buildTypes {
42-
release {
43-
minifyEnabled false
44-
}
45-
}
46-
lintOptions {
47-
disable 'GradleCompatible'
48-
}
49-
50-
if (agpVersion < 8) {
51-
compileOptions {
52-
sourceCompatibility JavaVersion.VERSION_1_8
53-
targetCompatibility JavaVersion.VERSION_1_8
54-
}
48+
buildTypes {
49+
release {
50+
minifyEnabled false
5551
}
52+
}
53+
lintOptions {
54+
disable 'GradleCompatible'
55+
}
5656
}
5757

5858
repositories {
59-
mavenCentral()
60-
mavenLocal()
61-
maven {
62-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63-
url("$rootDir/../node_modules/react-native/android")
64-
}
65-
google()
59+
mavenCentral()
60+
mavenLocal()
61+
maven {
62+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63+
url("$rootDir/../node_modules/react-native/android")
64+
}
65+
google()
6666
}
6767

6868
dependencies {
69-
//noinspection GradleDynamicVersion
70-
implementation "com.facebook.react:react-native:+" // From node_modules
71-
implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}"
72-
implementation 'io.intercom.android:intercom-sdk:15.4.0'
69+
//noinspection GradleDynamicVersion
70+
implementation "com.facebook.react:react-native:+" // From node_modules
71+
implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}"
72+
implementation 'io.intercom.android:intercom-sdk:15.10.+'
7373
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1+
<manifest package="com.intercom.reactnative" xmlns:android="http://schemas.android.com/apk/res/android">
22

33
</manifest>

android/src/main/java/com/intercom/reactnative/IntercomModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public void setLogLevel(String logLevel, Promise promise) {
228228
Log.d(NAME, "setLogLevel");
229229
promise.resolve(true);
230230
} catch (Exception err) {
231-
Log.e(NAME, "getUnreadConversationCount error:");
231+
Log.e(NAME, "setLogLevel error:");
232232
Log.e(NAME, err.toString());
233233
promise.reject(IntercomErrorCodes.SET_LOG_LEVEL, err.toString());
234234
}

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Please set up your React Native Development Environment for Android as described
3030
To run the app on Android, execute the following command:
3131

3232
```sh
33-
yarn example android --variant=fossDebug
33+
yarn example android
3434
```
3535

3636
To run the app on Android, execute the following command:

0 commit comments

Comments
 (0)