Giter VIP home page Giter VIP logo

airship-expo-plugin's Introduction

Airship Expo Plugin

Airship Expo Config Plugin. This plugin modifies the managed workflow builds to enable Push Notifications on both iOS and Android.

Installing

expo install airship-expo-plugin
yarn add urbanairship-react-native

Configuring the plugin

Add the plugin to the app.json:

  "plugins":[
    [
      "airship-expo-plugin",
      {
        "android":{
          "icon":"./assets/ic_notification.png"
        },
        "ios":{
          "mode": "development"
        }
      }
    ]
  ]

Android Config:

  • icon: Local path to an image to use as the icon for push notifications. 96x96 all-white png with transparency. The name of the icon will be the resource name.

iOS Config:

  • mode: The APNS entitlement. Either development or production

Calling takeOff

Call takeOff in the app initializes:

import { UrbanAirship } from 'urbanairship-react-native';

UrbanAirship.takeOff({
  default: {
    appSecret: "REPLACE_WITH_YOUR_APP_SECRET",
    appKey: "REPLACE_WITH_YOUR_APP_KEY"
  },
  site: "us",
  urlAllowList: ["*"],
  android: {
    notificationConfig: {
      icon: "ic_notification", // should match file name above
      accentColor: "#00ff00"
    }
  }
});

The Airship SDK can only be initialized once, and after being initialized the config will be applied on the next app start. Calling takeOff from React multiple times is allowed, but the config will not be applied until the next app run.

airship-expo-plugin's People

Contributors

rlepinski avatar infra-source 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.