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

cordova-base-push-android

v1.0.6

Published

Cordova BASE push Android

Downloads

13

Readme

cordova-base-push-android

This a Cordova plugin for BASE push notifications. It provides the functionality required to use FCM Push notifications from the BASE TSS System within a Cordova Android application.

Supported platform

  • Android

Installation

Installling the plugin:

cordova plugin add cordova-base-push-android

Adding your google-service.json file to your project

The google-services.json file is generally placed in the app/ directory (at the root of the Android Studio app module). If you don't have a google-services.json file yet, please take a look at this link https://firebase.google.com/docs/android/setup

  • IMPORTANT: If you don't provide the google-services.json file the app will fail to build.

Usage

Getting the device token

The following function return the device token in the success callback

      cordova.plugins.baseTss.getToken(function (token) {
            console.log('PUSH TOKEN : ', token);
        },
        function (error) {
            console.log('PUSH ERROR : ', error);
        });

Subscribe for Push notifications

Please provide the necessary parameters to the plugin. The registrationString should be a valid JSON containing using the following format :

var registrationJSON = 
"[
     {'category':'testCategory_1',
     'topics':['testTopic_1','testTopic_2']
     },
     {'category':'testCategory_2',
     'topics':['050']
     }
]";

Please note that the keywords 'category' and 'topics' are recognized by the plugin and that you should use them in your registration payload.

        var gcmSenderId = "XXXXXXX";
        var baseUrl = "https://base.daimler-tss.com/base.push.server/";
        var apiKey = "XXXXXXXXXXXXXXXX";
        var registrationJSON = "[{'category':'testCategory_1','topics':['testTopic_1','testTopic_2']},{'category':'testCategory_2','topics':['050']}]";

       cordova.plugins.baseTss.registerDevice(gcmSenderId, baseUrl, apiKey, registrationJSON, successCallback, failureCallback);

Unsubscribe from Push notifications

You can unregister for push notifications using the following function.

 cordova.plugins.baseTss.unregisterDevice(successCallback, failureCallback);

Customized icons

  • If you want to customize your app's icons please generate them with the following tool http://romannurik.github.io/AndroidAssetStudio/icons-notification.html
  • IMPORTANT: please name your image files "base_push_logo"
  • The website will generate a file called "base_push_logo" please copy it in the directory [PROJECT_NAME]/res/icon/android/
  • The icons should be mentioned in your config.xml file to be copied in the project. Example:
        <resource-file src="res/icon/android/base_push_logo/drawable-hdpi/base_push_logo.png" target="app/src/main/res/drawable-hdpi/base_push_logo.png" />
        <resource-file src="res/icon/android/base_push_logo/drawable-mdpi/base_push_logo.png" target="app/src/main/res/drawable-mdpi/base_push_logo.png" />
        <resource-file src="res/icon/android/base_push_logo/drawable-xhdpi/base_push_logo.png" target="app/src/main/res/drawable-xhdpi/base_push_logo.png" />
        <resource-file src="res/icon/android/base_push_logo/drawable-xxhdpi/base_push_logo.png" target="app/src/main/res/drawable-xxhdpi/base_push_logo.png" />
        <resource-file src="res/icon/android/base_push_logo/drawable-xxxhdpi/base_push_logo.png" target="app/src/main/res/drawable-xxxhdpi/base_push_logo.png" />

Customized sounds

  • Adding this to your config.xml will copy the sound files to your android platform.
<resource-file src="notifications_sounds/alarm.ogg" target="app/src/main/res/raw/alarm.ogg" />
  • From base send the name of your sound file (without extention) e.g: in this case send "alarm"

Author

This plugin was created by Mohamed ali Tlili so please don't hesitate to send an email to

Licence

Daimler AG Internal Source License Version 0.2, 24 January 2017 Preamble The goal of this license is to enable sharing of source code and other kinds of works within the Daimler corporation. It is intended to be used for all contributions for the benefit of projects within the whole of Daimler AG. Terms and Conditions Copyright (c) 2017 Daimler TSS, Architecture and Mobile Technologies. All rights reserved.

  1. Redistributions inside Daimler AG are permitted in source code and binary forms, with or without modification, provided that they retain the above copyright notice, this list of conditions and the following disclaimer
  2. Redistributions to outside Daimler AG are permitted in binary form under the copyright of Daimler. This includes commercial use.
  3. Redistributions to outside Daimler AG in source code form require the prior written permission of the contributing department and must retain the above copyright notice, this list of conditions and the following disclaimer. THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTING DEPARTMENT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTING DEPARTMENT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.