npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

castled-react-native-sdk

v1.28.0

Published

Castled React Native SDK

Downloads

48

Readme


npm version npm downloads min Android SDK version is 24 iOS 13.0+

Castled React Native SDK

:star: Introduction

Castled React Native SDK enables React Native mobile applications running on iOS and Android devices to receive messages send from the Castled Customer Engagement Platform. It is implemented as a Turbo Native Module with backward compatability. Turbo Native Modules are the next iteration on React Native Modules for apps based on the New Architecture. This SDK facilitates:

  • Receiving push notifications.
  • Displaying in-app messages and app inbox notifications.
  • Updating user profiles.
  • Collecting user events.

The following steps will guide app developers on how to seamlessly integrate the SDK into their mobile applications.

:roller_coaster: Getting Started

Installing SDK

Add the library to your project

npm install castled-react-native-sdk

Native Setup

Android

  1. Update build.gradle

    Include google-services plugin dependency in top-level gradle file

    // Top-level android/build.gradle file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            // Add google maven repository
            google()
        }
        ...
        dependencies {
            ...
            classpath("com.google.gms:google-services:<plugin-version>")
        }
    }
    

    Apply google-services plugin to app gradle file

        apply plugin: "com.google.gms.google-services"
  2. Add required permissions

    By default AndroidManifest.xml of the SDK includes the following permission requests. No developer action is required here.

    <!-- Castled SDK needs this permission to sync user token and campaign events  -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <!-- Castled SDK will use this permission to decide when to make network calls -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

iOS

  1. Pod Installation

    Navigate to ios directory of your app project and run pod install

Initializing SDK

Next step is to initialize the SDK. Initialization is typically done in App.js.

  import * as React from 'react';
  // Importing SDK modules required for initialization
  import {
    CastledNotifications,
    CastledConfigs,
    CastledLocation,
  } from 'castled-react-native-sdk';
  import Header from './Header';

  export default function App() {

    ...

    React.useEffect(() => {
      // Set config
      const configs = new CastledConfigs();
      configs.appId = '<app-id>';
      configs.location = CastledLocation.US;

      // Initialize SDK
      CastledNotifications.initialize(configs);
    }, []);

    ...

    return (
      <>
        ...
      </>
    );
  }
  • api-key is a unique key associated with your Castled account. It can be found in the Castled dashboard at Settings > Api Keys.
  • location is the region where you have your Castled account.

:books: Documentation

More details about the SDK integration can be found at https://docs.castled.io/developer-resources/sdk-integration/reactnative/getting-started

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library