Coder Social home page Coder Social logo

monzter50 / appboy-react-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from braze-inc/braze-react-native-sdk

1.0 1.0 0.0 1.05 MB

Public repo for the Braze React SDK

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

License: Other

JavaScript 49.55% Ruby 2.58% Objective-C 21.40% Java 25.52% Starlark 0.95%

appboy-react-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.

SDK Integration

See our Technical Documentation for instructions on integrating Braze into your React Native application.

Components

  • AppboyProject - Contains the AppboyProject 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.

Running the Sample App

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

cd AppboyProject/
yarn install

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

iOS

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

From the AppboyProject directory:

sudo gem install cocoapods
cd ios/
pod install
cd ../
npx react-native run-ios

Android

From the AppboyProject directory:

npx react-native run-android

In-App Messages

Integration

Native in-app messages display automatically out of the box on Android and iOS.

To get the in-app message data implement the IInAppMessageManagerListener delegate as described in our public documentation for Android and for iOS. This data can then be received in the JavaScript layer and used to instantiate a BrazeInAppMessage. A sample implementation of this is contained in AppboyProject.

Disabling automatic display

To disable automatic in-app message display for Android, your beforeInAppMessageDisplayed method implementation should return InAppMessageOperation.DISCARD.

To disable automatic in-app message display for iOS, your beforeInAppMessageDisplayed delegate implementation should return ABKInAppMessageDisplayChoice.discardInAppMessage.

Analytics

To log analytics using your BrazeInAppMessage, pass the instance into the logInAppMessageClicked, logInAppMessageImpression, and logInAppMessageButtonClicked (along with the button index) methods available on ReactAppboy.

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

appboy-react-sdk's People

Stargazers

 avatar

Watchers

 avatar

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.