Git Product home page Git Product logo

cli's Introduction

OneSignal CLI

⚠️ This tool is currently in Beta ⚠️

The OneSignal CLI is a tool to work with OneSignal projects.

Mac Setup

  1. Have Homebrew installed
  2. Run brew tap OneSignal/cli https://github.com/OneSignal/cli
  3. Run brew install onesignal-cli
  4. Run /usr/local/Cellar/onesignal-cli/{CLI_Version_Number}/bin/bundle install Example: /usr/local/Cellar/onesignal-cli/0.0.3/bin/bundle install

Available commands

  • onesignal help Lists the available commands in the OneSignal CLI
  • onesignal install-sdk Install the OneSignal SDK in the project

Installation Command

This command can be used to add the OneSignal SDK to your mobile application project. Currently only supports iOS and Android Native SDK install.

For iOS the command will:

  • Add push notification capabilities and background modes
  • Add the OneSignal cocoapod or Swift Package
  • Create and setup a Notification Service Extension
  • Setup an App Group for communication with the NSE.

Note that this command does not yet add initialization code to your app so please follow step 5 of the guide to complete installation.

For Android the command will:

  • Add the OneSignal gradle dependencies under project and app build.gradle file
  • Add the OneSignal initialization code under Application Class. If no application class is available, the CLI tool will create it for you at the given path.

Note: Re sync gradle might be needed after calling install-sdk

Options:

  • type - iOS or Android. Type of SDK to install. Required.
  • target - name of the App target to install in. Defaults to the entrypoint name. iOS only.

Arguments:

  • Entrypoint - Name of the target XCProject (iOS) or Application class file directory (Android). For Android, if no application class is available, the CLI will create it in the directory and name file provided. For the CLI to create the file for you, you will need to provide the directory inside the project and file name with the extension where you want the Application file to be created. Example: app/src/main/java/com/onesignal/testapplication/BaseApp.java
  • LANG - programming language to use for ios (objc, swift) or Android (java, kotlin)
  • APPID - Optional. OneSignal App ID. Not yet used for iOS installs.

Example Usage, run the following command on the root project directory where OneSignal SDK is going to be use

  • iOS: onesignal install-sdk --type iOS --entrypoint MyApp --lang objc --appid <APPID>
  • Android: onesignal install-sdk --type android --entrypoint app/src/main/java/com/onesignal/testapplication/BaseApp.kt --appid <APPID>

Limitations / Comming Soon

  • React Native, Flutter, Unity, Xamarin, and Cordova aren't currently supported. Stay tuned for support in a future release!
  • macOS is currently the only officially supported operating system.

cli's People

Contributors

brettshwom-onesignal avatar emawby avatar jeasmine avatar jkasten2 avatar jmadler 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.