Skip to content

Repository files navigation

ReactNativeDemo

Insider NPM JS react-native-insider InsiderAcademy

Description

This Demo contains simple methods that you can use with the Insider SDK.

Preview

Installation

Install all npm packages by running the npm install command in the home directory.

Replace partner name and app group value in App.tsx with your info.

Note: Can easily find the warnings added as comments by searching the FIXME-INSIDER key in the project and you can quickly make the necessary arrangements for the project.

Android

  1. Add google-services.json and agconnect-services.json to android/app folder.
  2. Add your keystore file to android/app folder and replace signingConfigs attributes in android/app/build.gradle file with your info.
  3. Replace manifestPlaceholders -> partner value with your partner name in android/app/build.gradle file. (This step is important to add test device with QR or Email in the panel.)
  4. And run project with npm run android command.

iOS

  1. Go to the iOS folder with terminal and run the pod install command.
  2. Open XCode and check the app group and bundle identifier for all targets.
  3. Replace insider URL type in main target Info -> URL Types with your partner name. (This step is important to add test device with QR or Email in the panel.)
  4. Change the app group value in InsiderNotificationService/NotificationService.swift and InsiderNotificationContent/NotificationViewController.swift files.
  5. And run project with XCode.

New Architecture

This demo runs on the New Architecture — Fabric and bridgeless — and react-native-insider works under it with no extra setup. There are no migration steps to follow: the SDK exports no native UI components, so Fabric is not involved, and it registers as a legacy native module that React Native bridges through its interop layer.

A few things worth knowing:

  • No API changes. Every method available before the migration still exists and behaves the same. Nothing was removed between 7.x and 8.x.
  • Hermes and Fabric are not configured here. On React Native 0.82+ use_react_native! enables both regardless of what the Podfile asks for, so passing :hermes_enabled or :fabric_enabled has no effect. This project leaves them out rather than setting values that are silently ignored.
  • Android enables the New Architecture through newArchEnabled=true in android/gradle.properties, which is the default for new projects.

If you hit something that behaves differently with the New Architecture enabled, please open an issue with your React Native version and a log excerpt.

About Universal Links

Android

  1. Replace URL in AndroidManifest.xml file with your domain.

Note: If you are not directed to the application when you click on the URL or scan it with QR, you may not have done the verify step for the URL you set. To solve this problem, open the "Supported web addresses" settings from the "Set as default" settings in the application settings and enable the URL you set.

Ref: https://developer.android.com/training/app-links/verify-android-applinks

iOS

  1. Release app link in Associated Domain with your domain for main target.

If you are not directed to the application when you click on the URL or scan it with QR, you may not have done the verify step for the URL you set. To solve this problem, you can add a verification file to the root directory of your domain.

Ref: https://developer.apple.com/documentation/xcode/supporting-associated-domains

Troubleshooting

Missing node version

You will see the following error upon building the project:

[Warning] You need to configure your node path in the ".xcode.env" file environment. You can set it up quickly by running: echo export NODE_BINARY=$(command -v node) > .xcode.env in the ios folder. This is needed by React Native to work correctly.
We fallback to the DEPRECATED behavior of finding node. This will be REMOVED in a future version. You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment /Users/youruser/Library/Developer/Xcode/DerivedData/ReactNativeDemo-armazsjamjdnozdegphlbkfgioxp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/hermes-engine.build/Script-46EB2E00022190.sh: line 9: : command not found Command PhaseScriptExecution failed with a nonzero exit code

In order to circumvent this, you need to export your node version into .xcode.env (and .xcode.env.local just in case) file.

echo export NODE_BINARY=$(command -v node) > ios/.xcode.env
echo export NODE_BINARY=$(command -v node) > ios/.xcode.env.local

About

This Demo contains simple methods that you can use with the Insider SDK.

Topics

Resources

Security policy

Stars

1 star

Watchers

6 watching

Forks

Used by

Contributors

Languages