Giter VIP home page Giter VIP logo

braze-inc / braze-react-native-sdk Goto Github PK

View Code? Open in Web Editor NEW
63.0 26.0 81.0 2.38 MB

Public repo for the Braze React SDK

Home Page: https://www.braze.com

License: Other

JavaScript 30.70% Objective-C 3.72% Ruby 1.43% Kotlin 28.14% Swift 0.16% TypeScript 14.77% Objective-C++ 21.08%
android braze ios react-native javascript sdk typescript marketing-automation customer-engagement in-app-messaging

braze-react-native-sdk's Introduction

Braze React SDK

Effective marketing automation is an essential part of successfully scaling and managing your business. Braze empowers you to build better customer relationships through a seamless, multi-channel approach that addresses all aspects of the user life cycle Braze helps you engage your users on an ongoing basis.

Version Support

Braze Plugin React Native Supports New Architecture?
9.0.0+ >= 0.71
6.0.0+ >= 0.68 ✅ (>= 0.70.0)
2.0.0+ >= 0.68
<= 1.41.0 <= 0.71

Braze Expo Plugin

If you're using Expo, you can install our plugin to integrate the React Native SDK without any native code. See the Braze Expo Plugin Github for more details.

Running the Sample App

  • BrazeProject - Contains the BrazeProject sample app with integration examples for the React Native bridge. This sample app integrates the iOS bridge via manual linking, and the iOS SDK via Cocoapods. It can also optionally integrate the iOS bridge using Cocoapods via a local Podspec.

The following commands apply to both sample projects and use the BrazeProject directory as an example.

cd BrazeProject/
yarn install

# In a separate tab:
cd BrazeProject/
npx react-native start

iOS

Our sample app integrates the native Braze iOS SDK through Cocoapods.

From the BrazeProject directory:

sudo gem install cocoapods
cd ios/
pod install # If you are using the New Architecture, you need to run `RCT_NEW_ARCH_ENABLED=1 pod install` instead.
cd ../
npx react-native run-ios

Android

From the BrazeProject directory:

npx react-native run-android

Style

  • Generally we try to mimic the Braze Web SDK's Javascript interface where appropriate.
  • We use eslint as our linter. From the root directory, run npm run lint to list errors or npm run lint-fix to automatically fix errors. To override the rules in the standard-react config, add "rules" in .eslintrc.json.

Testing

  • We use jest for testing the React SDK.
  • Run the tests and code coverage report using npm test

braze-react-native-sdk's People

Contributors

altaywtf avatar briancaw avatar bucimis avatar danieldecsi avatar davidbielik avatar dcvz avatar gilesvangruisen avatar hokstuff avatar jerielng avatar lowip avatar mcabs3 avatar pietropizzi avatar sen-lu avatar vanessaland avatar wesleyorbin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

braze-react-native-sdk's Issues

sdk not compatible with react-native 0.57.x and android flavors

Error description

The project won't build if using the latest react native version and it has flavors in the android configuration.

Error on react-native run-android

> Task :react-native-appboy-sdk:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest FAILED
D8: Program type already present: android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-appboy-sdk:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/0.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/1.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/2.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/3.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/4.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/5.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/6.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/7.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/8.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/9.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/10.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/11.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/12.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/13.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/14.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/15.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/16.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/17.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/18.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/19.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/20.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/21.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/22.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/23.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/24.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/25.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/26.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/27.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/28.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/29.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/30.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/31.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/32.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/33.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/34.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/35.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/36.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/37.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/38.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/39.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/40.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/41.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/42.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/43.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/44.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/45.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/46.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/47.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/48.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/49.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/50.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/51.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/52.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/53.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/54.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/55.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/56.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/57.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/58.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/59.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/60.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/61.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/62.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/63.jar, /Users/v.reis/workspace/temp/appboyBug/node_modules/react-native-appboy-sdk/android/build/intermediates/transforms/dexBuilder/androidTest/debug/64.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s

How to Reproduce

react-native init appboyBug
cd appboyBug/
npm install react-native-appboy-sdk@latest --save
react-native link

After this the project should build normaly.
however if we add a android flavor to it, e.g.:
edit /android/app/build.gradle

android {
    ...

    flavorDimensions "version"
    productFlavors {
        dev {
            dimension "version"
            applicationId 'com.appboybug.dev'
        }
    }

Comments

I believe that this is somehow related to your android build project referencing a very old react-native version at -> https://github.com/Appboy/appboy-react-sdk/blob/master/android/build.gradle#L17

How to close Slide-up in-app message programatically

I have a situation when an iOS action sheet popup is displayed over an opened in-app message.
In this case focus is still on the app window and action sheet not working

Any idea how to resolve this problem?
or how to close in-app message before action popup?

AppboyReactBridge.launchNewsFeed() doesn't update locale

Hi team,
In our app we call Appboy.launchNewsFeed(), which calls the same method in the SDK's AppboyReactBridge. This brings up the Newsfeed in a new window in the user's app language.

After the user changes their language in Settings (both in our app and natively), the Newsfeed remains in the old language. Even after reinstalling our app, the issue persists. I suspect the view is being cached by Appboy.

Is there any way to fix this behavior? Thanks in advance!

notificationSubscriptionTypes: OPTED_IN

notificationSubscriptionTypes OPTED_IN should be "optedin" in /node_modules/react-native-appboy-sdk/index.js

ATM it is:
NotificationSubscriptionTypes: {
'OPTED_IN': 'opted_in',
'SUBSCRIBED': 'subscribed',
'UNSUBSCRIBED': 'unsubscribed'
},

Trigger IAM ready from JS

Affects: iOS & Android

Problem

When using InAppMessaging with Braze on a fresh start, there is a gap where the user can press a deep-link present on the IAM, while the JS is still not completely ready. This is particularly easy to reproduce with a large JS codebase or a long loading (waiting for a response from backend for example).

➡️ This result in the loss of the deep link 😢 😢 😢

Potential solution

One solution would be to pause all IAM while the JS is not ready and call an Appboy.isReady() from the JS side when we are ready to handle deep link 🤗

Context

We've already talked to Braze support about this issue. I'm adding their response here for more context.

From Braze support ❤️ :

Hi all,

Happy Friday! Just jumping in here with some additional information. It looks like this behaviour is easier to reproduce when there’s a large amount of JS on a less performant phone.

As far as we can tell from your implementation, you are already handling this with a workaround but we believe the best solution might be to build a native IAM manager listener that holds on to all IAMs until receiving a signal from JS that the JS is loaded and IAMs can be displayed [that way you don't need to delay init or disable]. Ideally, we would have an out of the box callback for "IAMs ready" - we have added this as an enhancement request and will work to implement this in the future.

Let me know if you have any follow up questions or concerns on this.

Kind regards,

AppboyReactUtils.h not found for populateInitialUrlFromLaunchOptions:launchOptions

I have an ejected Expo (react native) project.

I needed to call populateInitialUrlFromLaunchOptions:launchOptions in my appdelegate so I could getInitialURL. However, importing the react utils like in the sample project #import "AppboyReactUtils.h" did not work for me. I had to import like so #import <AppboyReactBridge/AppboyReactUtils.h>. This introduced another issue where the AppboyReactBridge library wasn't copying the AppboyReactUtils.h file.

I was wondering if this could be added to the project or if there is a better way to do this?

Here is a diff where I updated the AppboyReactBridge library if necessary:

+++ b/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge.xcodeproj/project.pbxproj
@@ -10,6 +10,7 @@
 		D4DB659B1D8C973800EFA6B6 /* AppboyReactUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = D4DB659A1D8C973800EFA6B6 /* AppboyReactUtils.m */; };
 		E3D0A75E1C668BB90027828A /* AppboyReactBridge.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E3D0A75D1C668BB90027828A /* AppboyReactBridge.h */; };
 		E3D0A7601C668BB90027828A /* AppboyReactBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = E3D0A75F1C668BB90027828A /* AppboyReactBridge.m */; };
+		F6F7E18F21E040BF0068CF89 /* AppboyReactUtils.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D4DB65991D8C973800EFA6B6 /* AppboyReactUtils.h */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
@@ -19,6 +20,7 @@
 			dstPath = "include/$(PRODUCT_NAME)";
 			dstSubfolderSpec = 16;
 			files = (
+				F6F7E18F21E040BF0068CF89 /* AppboyReactUtils.h in CopyFiles */,
 				E3D0A75E1C668BB90027828A /* AppboyReactBridge.h in CopyFiles */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Not compatible with React Native 0.54.2

Since upgrading to 0.54.2 we are unable to run Android:

product-mobile/android/app/src/main/AndroidManifest.xml:10:7-34 Error:
        Attribute application@allowBackup value=(false) from AndroidManifest.xml:10:7-34
        is also present at [productMobile:react-native-appboy-sdk:unspecified] AndroidManifest.xml:12:9-35 value=(true).
        Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:8:5-74:19 to override.

I think we just need to set android:allowBackup="false" in https://github.com/Appboy/appboy-react-sdk/blob/master/android/src/main/AndroidManifest.xml.

AppboyReactBridge raises Appboy sharedInstance warning

in AppboyReactBridge.m, setSDKFlavor is called as soon as we import 'react-native-appboy-sdk'
(import ReactAppboy from 'react-native-appboy-sdk';)
RCT_EXPORT_METHOD(setSDKFlavor) {
[Appboy sharedInstance].sdkFlavor = REACT;
}
At this time [Appboy startWithApiKey] has not returned yet and a warning is raised

 ********************************************
 **             !! WARNING !!              **
 **     [Appboy sharedInstance] called     **
 **     before Appboy was initialized,     **
 **       returning nil. Please make       **
 ** sure you call [Appboy startWithApiKey] **
 **  before accessing the sharedInstance.  **
 ********************************************

lock portrait mode on launchNewsFeed method

i have to lock the orientation mode 'portrait' on default launchNewsFeed layout . but i can't find any method for that . i search and i found a solution that if i add activity on androidManifest.xml and add property like portrait mode but the problem is that i can't find the activity name . please tell me the activity name or any method to overcome this issue . Thanks .

Android build fails after update to 1.17.1

My Android build is failing with this error after updating react-native-appboy-sdk from 1.14.0 to 1.17.1

I simply ran yarn update react-native-appboy-sdk@latest, since the Release page did not say I had to make updates to the configs in the Android folder.

I'm on react-native: 0.59.9

The error

* What went wrong:
Execution failed for task ':app:preDevDebugBuild'.
> Could not resolve all files for configuration ':app:devDebugRuntimeClasspath'.
   > Could not resolve com.appboy:android-sdk-ui:3.7.0.
     Required by:
         project :app > project :react-native-appboy-sdk
      > Could not resolve com.appboy:android-sdk-ui:3.7.0.
         > Could not get resource 'https://jitpack.io/com/appboy/android-sdk-ui/3.7.0/android-sdk-ui-3.7.0.pom'.
            > Could not HEAD 'https://jitpack.io/com/appboy/android-sdk-ui/3.7.0/android-sdk-ui-3.7.0.pom'. Received status code 522 from server: Origin Connection Time-out

I don't see anything about JitPack being down. I cannot open the link in my browser, could it be that the link is dead?

Or is there something else going on, maybe some updates to make in the Android folder..?

Release 1.4.0?

Hi Appboy Team,

I need the newly-added .podspec file. But it looks like it has yet to be officially released. Right now, yarn install does not include those changes when including react-native-appboy-sdk in my package.json so I have to refer to a specific commit SHA to get it to work which feels brittle.

Is it possible to cut a new release? Thank you!

Is it possible to retreive braze_id of current user

I did not find this functionality and it seems quite important to being able to identify the user from the backend fo anonymous users already. Is there any plan to add this or is it possible and I am missing it out on the documentation?

Incompatible with RN 0.60+ / AndroidX

After upgrading react-native to 0.60+ (in my case 0.61.2), which migrates to using AndroidX for Android support libraries, I'm getting the following errors on compile:

> Task :react-native-appboy-sdk:compileDebugJavaWithJavac FAILED
/my-app/node_modules/react-native-appboy-sdk/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java:4: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/my-app/node_modules/react-native-appboy-sdk/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java:590: error: cannot find symbol
  private @Nullable Card getCardById(String id) {
           ^
  symbol:   class Nullable
  location: class AppboyReactBridge
2 errors

It appears that the bridging code here needs to be updated to use the new androidx.support libraries to enable compilation going forward.

AppboyKit.h not found

I followed your instructions on the ReadMe and everything seems to have hooked up with rnpm, but when I run that app and do a simple changeUser I get an error on iOS

TypeError: undefined is not an object (evaluating 'AppboyReactBridge.changeUser')

From trying to link it manually, it won't build in xCode because it says that the AppboyKit.h is not found.

Maybe I am missing something, but none of your methods have been successful for me.

RN: 0.33.1
AppBoy SDK: 1.0.0
Simulator: iPhone 6

Invalid API key error when using correct ID

I have set up Appboy on iOS by following the instructions:

  1. Install the Appboy iOS SDK into your iOS project. using manual integration
  2. npm install react-native-appboy-sdk@latest --save
  3. Add AppboyReactBridge.xcodeproj library to my xcode project
  4. Add libAppboyReactBridge.a to Build Phases -> Link Binary With Libraries
  5. AppboyKit is in the root (alongside Libraries, Frameworks etc.) so I have not updated the ‘Header Search Paths’

Everything seems to be working ok:

2017-07-27 15:44:23.519 [info][tid:main][AppboyReactBridge.m:55] [Appboy sharedInstance] changeUser with value 46456546546464bsdfd5654g6fd564efs5
2017-07-27 15:44:23.519403+0100 aMobile[2944:784709] [Appboy sharedInstance] changeUser with value 46456546546464bsdfd5654g6fd564efs5
2017-07-27 15:44:23.519498+0100 aMobile[2944:784709] [APPBOY] Got request to switch to the current user ID. There is nothing to transition, returning without action
2017-07-27 15:44:23.520 [info][tid:main][AppboyReactBridge.m:66] [Appboy sharedInstance] logCustomEvent with eventName cordovaCustomEventWithProperties
2017-07-27 15:44:23.519636+0100 aMobile[2944:784709] [Appboy sharedInstance] logCustomEvent with eventName cordovaCustomEventWithProperties
2017-07-27 15:44:23.521 [info][tid:main][AppboyReactBridge.m:77] [Appboy sharedInstance].user.firstName =  firstName
2017-07-27 15:44:23.521091+0100 aMobile[2944:784709] [Appboy sharedInstance].user.firstName =  firstName
2017-07-27 15:44:23.524 [info]

But then I get an API key error:

[APPBOY] Invalid API key

Inside App Settings on the Appboy dashboard I have tried both the App Group Identifier and the iOS application identifier, but I still always get the same error.

Here is my AppDelegate.m file:

#import "AppDelegate.h"
#import "CodePush.h"
#import "AppboyKit.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  
  NSURL *jsCodeLocation;

  
#ifdef DEBUG
    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#else
    jsCodeLocation = [CodePush bundleURL];
#endif

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"aMobile"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  
  UIViewController *rootViewController = [UIViewController new];
  
  rootViewController.view = rootView;
  
  self.window.rootViewController = rootViewController;
  
  [self.window makeKeyAndVisible];
  
  [Appboy startWithApiKey:@"MY_KEY_FROM_DASHBOARD"
            inApplication:application
        withLaunchOptions:launchOptions];
  
  return YES;
}

@end

Is there something else I need to send?

Cheers,

Stu

Initialization SDK from react-native

Hi Braze,
We use react-native SDK for our app. We would like to have a better control over initialization process of SDK library through react-native code.
One of case we face is to limit anonymous user creation every time use uses app. We would like to call init SDK upon some kind of event, i.e. user login together will changeUser() call.

Should be possible to have an initialization method available in react-native library instead of in native code?
If so, we would probably need to postpone a call from native code that registers a push token:
[[Appboy sharedInstance] registerPushToken:[NSString stringWithFormat:@"%@", deviceToken]];
save this token and send it through react-native code using registerPushToken() method.
Is that correct?

Should be possible to pass some parameter to that SDK initialization method that disables creation of anonymous user, i.e. anonymous: false?

Thanks!
David Mrnustik

News Feed counts, indicators, and OS

We are trying to implement the News Feed as a source of updates and promotions, but finding it exceedingly difficult in the current version.

  • We are not getting (or able to get) the counts for unread messages.
  • Only in Android does the unread indicator show and reset after opening the News Feed, iOS is always in a 'read' state.
  • No ability for requestFeedRefresh for iOS in RN — or at least upgrade the iOS SDK
  • No getUnreadCardCountForCategories to do a refresh in the background

Help!

Android deep linking

This is more or less a question rather than an issue...

I have got deep linking setup and I can confirm it is working with the following adb test command.

$ adb shell am start -W -a android.intent.action.VIEW -d "example://gizmos" com.example.android

The command launches the app and deep linking is working fine.

However, when I send a push notification with deep linking, my device received the notification but nothing happens when I click on it - the app does not even launch

https://www.braze.com/docs/assets/img_archive/deep_link_click_action.png?7f05e56e413bf9d0fdc4810f0948d4ca

According to the little help text in the image, I need to update my broadcast receiver in native code.

https://github.com/Appboy/appboy-android-sdk/blob/master/samples/custom-broadcast/src/main/java/com/appboy/custombroadcast/AppboyBroadcastReceiver.java

This is what I found in the Braze documentation, I can add the java file and change the AndroidManifest on the native side to support this but how do I send the event back to the react native side to handle it?

Would you be able to provide me example of how I can set this up?

P.S. when I send a push notification with the OPEN APP option, it worked fine, just not with deep linking

News Feed doesn't close after pressing a deeplink

If you add a deeplink to a news feed item, and that deeplink is internal to the same app, the deeplink will work... but the news feed modal didn't automatically close showing what happened behind it.

Can't run iOS after upgrading to the latest cocoa pods and react native sdk

Versions:

npm:

"react-native": "^0.55.4",
"react-native-appboy-sdk": "1.6.0"

lockfile:

- Appboy-iOS-SDK (3.5.1):
    - Appboy-iOS-SDK/UI (= 3.5.1)
  - Appboy-iOS-SDK/Core (3.5.1)
  - Appboy-iOS-SDK/Feedback (3.5.1):
    - Appboy-iOS-SDK/Core
  - Appboy-iOS-SDK/InAppMessage (3.5.1):
    - Appboy-iOS-SDK/Core
    - SDWebImage/GIF (~> 4.0)
  - Appboy-iOS-SDK/NewsFeed (3.5.1):
    - Appboy-iOS-SDK/Core
    - SDWebImage/GIF (~> 4.0)
  - Appboy-iOS-SDK/UI (3.5.1):
    - Appboy-iOS-SDK/Core
    - Appboy-iOS-SDK/Feedback
    - Appboy-iOS-SDK/InAppMessage
    - Appboy-iOS-SDK/NewsFeed

When running iOS we get the errors:

mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:225:3: use of undeclared identifier 'ABKFeedViewControllerModalContext'

  ABKFeedViewControllerModalContext *feedModal = [[ABKFeedViewControllerModalContext alloc] init];
              ^                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:225:38: use of undeclared identifier 'feedModal'

  ABKFeedViewControllerModalContext *feedModal = [[ABKFeedViewControllerModalContext alloc] init];
  ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:225:52: use of undeclared identifier 'ABKFeedViewControllerModalContext'

  ABKFeedViewControllerModalContext *feedModal = [[ABKFeedViewControllerModalContext alloc] init];
                                     ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:226:3: use of undeclared identifier 'feedModal'

  feedModal.navigationItem.title = @"News";
                                                   ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:231:7: use of undeclared identifier 'feedModal'

      feedModal.minimumCardMarginForiPhone = minimumCardMarginForiPhone.floatValue;
  ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:235:7: use of undeclared identifier 'feedModal'

      feedModal.minimumCardMarginForiPad = minimumCardMarginForiPad.floatValue;
      ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:239:7: use of undeclared identifier 'feedModal'

      feedModal.cardWidthForiPhone = cardWidthForiPhone.floatValue;
      ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:243:7: use of undeclared identifier 'feedModal'

      feedModal.cardWidthForiPad = cardWidthForiPad.floatValue;
      ^



mobile/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:248:45: use of undeclared identifier 'feedModal'

  [mainViewController presentViewController:feedModal animated:YES completion:nil];
      ^


** BUILD FAILED **


The following commands produced analyzer issues:

	Analyze Base/RCTModuleMethod.mm normal x86_64
(1 command with analyzer issues)

The following build commands failed:
	CompileC mobile/ios/build/Build/Intermediates.noindex/AppboyReactBridge.build/Debug-iphonesimulator/AppboyReactBridge.build/Objects-normal/x86_64/AppboyReactBridge.o AppboyReactBridge/AppboyReactBridge.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/Devlyfe.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
lstat of mobile/ios/build/Build/Products/Debug-iphonesimulator/Devlyfe.app failed: No such file or directory
No such file or directory
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/Devlyfe.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Android push notification deep link from background restarting app

I have a detached expo project set up with this SDK. I am having issues where opening an Android app from tapping a push notification with a deep link causes the android app to restart/open from the splash screen. This leads to the listener from not firing, and getInitialUrl() just returns the base deep link.

This only occurs when the application was backgrounded. From a killed state, when a push notification is opened the application starts and uses getInitialUrl(). It deep links appropriately in this case.

The project was configured according to the Braze docs and mainActivity launchmode is set to singleTask.


Seems like the issue is specifically caused by the intent set for the notification when there is a deep link.
AppboyNotificationUtils.setContentIntentIfPresent(context, notificationBuilder, notificationExtras);

I was able to simply deep link using:
Intent pushActionIntent = (new Intent(Intent.ACTION_VIEW, Uri.parse("app://friends"))).setClass(context, MainActivity.class);
However, this would bypass the default AppboyFcmReceiver and the logic contained there.

Date as eventProperty in logCustomEvent

Is there a way to add JS Date value as a parameter in logCustomEvent function?

According to appropriate description it seems like there is no way to do that. But native sdk's guide says that

You can add metadata about custom events by passing an NSDictionary populated with NSNumber, NSString, or NSDate values.

for IOS and

Properties are defined as key-value pairs. Keys are String objects and values can be String, int, float, boolean, or Date objects.

for Android.

So, how was supposed to solve that part of functionality?

Android dependency issue

Just followed the docs for integrating Braze with a react-native app. Android does not build because of the following error:

A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_developmentDebugApk'.
   > A problem occurred configuring project ':react-native-appboy-sdk'.
      > Could not resolve all dependencies for configuration ':react-native-appboy-sdk:_debugPublishCopy'.
         > Could not find com.appboy:android-sdk-ui:2.4.0.
           Required by:
               project :react-native-appboy-sdk

This happens after this:

$ react-native init --version=0.55.4 Test1
$ cd Test1
$ npm install
$ react-native run-android
$ npm install react-native-appboy-sdk@latest --save
$ react-native link
$ react-native run-android

[1.17.x] iOS build does not compile because of undeclared ABKContentCard property

Hello,

iOS build fails with

  • React SDK: 1.17.x
  • React-Native: 0.59.8

Error is shown below:

node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m:374:49: property 'clicked' not found on object of type 'ABKContentCard *'

  formattedContentCardData[@"clicked"] = @(card.clicked);

Essentialy the complain is about this line
formattedContentCardData[@"clicked"] = @(card.clicked);
in file AppboyReactBridge.m

Thanks

how to deep link to specific screen from a push notification. [Android]

Hi @Bucimis
I'd like to do deep linking to some specific screens from a push notification.
I've read the docs but I can't find any clear steps to setup deep links for react native app.
I'm not familiar with Java and Objective-C so I'd really appreciate if you could guide me how to setup deep-linking both on android and ios.

Thanks

Update Android SDK UI dependency

Hello!

I'm integrating Braze into a native Android app that also uses React Native. Per the Android documentation, I am using com.appboy:android-sdk-ui:2.2.2. However, this React Native SDK still references version 2.1.4. It would be great if this project could be updated to reference the latest version of the Android SDK so that users don't have to downgrade.

Thank you!

AppboyProject fails to start

I was following steps to run AppboyProject on Android and end up with red screen on the Android device.

screenshot_20180511-134901

On the other side, iOS build (based on the documentation) fails to start with

ppboyKit.h' file not found
#import "AppboyKit.h"
        ^~~~~~~~~~~~~
1 error generated.



** BUILD FAILED **



The following build commands failed:
	CompileC /Users/josefsin/dev/github/appboy-react-sdk/AppboyProject/ios/build/Build/Intermediates.noindex/AppboyReactBridge.build/Debug-iphonesimulator/AppboyReactBridge.build/Objects-normal/x86_64/AppboyReactBridge.o AppboyReactBridge/AppboyReactBridge.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/AppboyProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AppboyProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Are there any specific requirements when running the AppboyProject?

When will react-native-appboy-sdk be upgraded to include Braze SDK v3.11.0

Recently I got the following email from Braze, it asked me to upgrade Braze SDK to v3.11.0. The current react-native-appboy-sdk on 1.8.1 is using 3.8.4 SDK for iOS. When will react-native-appboy-sdk be upgraded to include 3.11.0?

We are currently on 3.8.4 SDK for iOS, need to update it to the latest Braze SDK v3.11.0.

Once we have that implemented, we should anticipate seeing a slight increase in our iOS push audiences--------------------------------------

We would like to inform you of an important issue regarding iOS push messaging given that you utilize our iOS SDK platform to send push notifications.

Issue DescriptionWe’ve identified that a small amount of your iOS users will not receive a push when both of the following occur:

Users disable Banner style notifications within the iOS system notification settings, but leave other notification styles enabled.You send an iOS push message using a Campaign or Canvas with the Push Enabled Filter set to to “true.”ImpactWe have determined that you have integrated the Braze iOS SDK and have active iOS push campaigns or Canvas messages and have used the Push Enabled filter described above in the past 30 days.

How do I resolve this issue?Please notify your iOS engineers to update to the latest Braze SDK v3.11.0.

Once your team has implemented the fix, you should anticipate seeing a slight increase in your iOS push audiences if your iOS push campaigns or Canvas workflow steps use the Push Enabled Filter.

Please contact [email protected] or your Customer Success Manager with any questions.

how to register for push notification

I have installed appboy and set up my ios app for PN, managed to set a user ID but user is not registered for push notifications.
I am quit confused by the lack of documentation for the push notification actually.
Does it have to be done via native code or on react side ?
Any help would be appreciated

screen shot 2018-03-07 at 07 43 23

screen shot 2018-03-07 at 07 48 02

In App Message not appearing

Hi! we've configured Braze SDK on Android
When we try to send a In App Message test message for a specific user (our test user), it says:

Warning: None of the selected users have matching push tokens for In-App Message.

What else should I do to configure this? This user has already accepted to receive push notifications

Android support for customer feedback

We currently use the iOS process for allowing customer feedback. We would love to be able to do the same on Android using the React Native bridge.

App crash on Android when no properties passed to logCustomEvent

Hi

I've noticed that if you pass no event properties to the logCustomEvent call, on Android the app crashes, whereas on iOS it's successful.

The error is:

2019-06-18 10:38:22.780 18481-18630/com.myapp E/unknown:ReactNative: Exception in native call
    java.lang.NullPointerException: Attempt to invoke interface method 'com.facebook.react.bridge.ReadableMapKeySetIterator com.facebook.react.bridge.ReadableMap.keySetIterator()' on a null object reference
        at com.appboy.reactbridge.AppboyReactBridge.populateEventPropertiesFromReadableMap(AppboyReactBridge.java:109)
        at com.appboy.reactbridge.AppboyReactBridge.logCustomEvent(AppboyReactBridge.java:104)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:874)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:198)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
        at java.lang.Thread.run(Thread.java:764)

and it's happening here:
https://github.com/Appboy/appboy-react-sdk/blob/master/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java#L109

So are these properties actually required, because the documentation suggests otherwise?
It seems redundant making the call like this: logCustomEvent("event", {}).

Cheers

Ant

iOS deep linking not working on notification launch

I am getting flaky experiences with notifications that have deep linking embed on iOS.

  1. When the app is previously launched, deep linking embedded works 100% of the time

  2. When the app is closed or forced closed, launching the app via a notification, deep linking works ONLY when the phone is unlocked.

I checked out the documentation and the comments on the library but failed to get a consistent result.

Believe the culprit could be Appboy.getInitialURL((url) => { alert(url); });

I put alerts and console logs and it seems that regardless if it is a release or debug build, the url is always null hence my handle function was never called.

I even followed the example project in this repo and the helper code provided by a Braze representative.

Any help would be appreciated.

Cheers

[3.20.x]iOS build failed <> #import <SDWebImage/SDAnimatedImageView+WebCache.h>

Hello,

iOS build failed with

  • React SDK: 1.17.x
  • iOS SDK: 3.20.x
  • React-Native: 0.59.9
  • Pod: 1.7.5

Looks like SDWebImage 5.0 fail to link to the build...

All good for Android 👍

Thanks!


output:

The following build commands failed:
CompileC /Users/ivanabrossimov/Documents/heroes/oly-app-united/ios/build/united-dev/Build/Intermediates.noindex/AppboyReactBridge.build/Debug-iphonesimulator/AppboyReactBridge.build/Objects-normal/x86_64/AppboyReactBridge.o /Users/ivanabrossimov/Documents/heroes/oly-app-united/node_modules/react-native-appboy-sdk/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler


Screenshot 2019-09-16 at 15 38 29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.