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-plugin-emma-sdk

v1.7.1

Published

Cordova plugin for EMMA SDK

Downloads

197

Readme

Cordova EMMA plugin for Android and iOS

npm version Build Status

For any question related to support, you can write to [email protected], we will answer as soon as possible.

EMMA website: https://emma.io Documentation: https://docs.emma.io Developer Documentation: https://developer.emma.io

❗️Important Native SDK documentation is conceptually equals to cordova plugin.

Table of content

Native SDK equivalences

  • iOS SDK v4.13.1
  • Android SDK v4.13.0

📲Installation

$ cordova plugin add cordova-plugin-emma-sdk --variable ADD_PUSH=1

🚀 Setup

❗️Important This setup is focused on an Ionic app.

Session key.

To obtain the key you have to create an EMMA account and create an app. In My account section you will find the key. For more information contact support.

First, add to config.xml file:

<platform  name="android">
	<resource-file src="resources/android/notification/drawable-mdpi-notification.png" target="app/src/main/res/drawable-mdpi/notification.png" />
	<resource-file src="resources/android/notification/drawable-hdpi-notification.png" target="app/src/main/res/drawable-hdpi/notification.png" />
	<resource-file src="resources/android/notification/drawable-xhdpi-notification.png" target="app/src/main/res/drawable-xhdpi/notification.png" />
	<resource-file src="resources/android/notification/drawable-xxhdpi-notification.png" target="app/src/main/res/drawable-xxhdpi/notification.png" />
	<resource-file src="resources/android/notification/drawable-xxxhdpi-notification.png" target="app/src/main/res/drawable-xxxhdpi/notification.png" />

	<resource-file src="google-services.json" target="app/google-services.json" />

	<!-- Optional permissions for location -->
	<config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
		<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
		<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
	</config-file>

	<config-file parent="/manifest/application" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">

		<service android:enabled="true" android:exported="false" android:name="io.emma.android.push.EMMAFcmMessagingService">
			<intent-filter>
				<action android:name="com.google.firebase.MESSAGING_EVENT" />
			</intent-filter>
		</service>

		<activity android:name="io.emma.android.activities.EMMADeepLinkActivity" android:noHistory="true" android:theme="@android:style/Theme.NoDisplay">
			<intent-filter>
				<action android:name="android.intent.action.VIEW" />
				<category android:name="android.intent.category.DEFAULT" />
				<category android:name="android.intent.category.BROWSABLE" />
				<data android:scheme="${scheme}" />
			</intent-filter>
		</activity>

		<meta-data android:name="io.emma.DEEPLINK_OPEN_ACTIVITY" android:value="${config_id}.MainActivity" />

	</config-file>
<platform>

Remember replace:

  • ${config_id} for id in config.xml file.
  • ${scheme} for your app scheme (eg. ionicapp). In iOS is necessary configure URL types in Xcode.
  • Add the google-services.json explained in push

Declare window at the top of component where plugin is used:

declare var window: any;

Initialize the plugin:

this.platform.ready().then(() => {
  document.addEventListener('onDeepLink', (event) => {
    //process deeplink(eg. added in rich push)
  });
  document.addEventListener('onDeviceId', (event) => {
    //event.deviceId
  });

  const EMMA = window.plugins.EMMA; // gets EMMA plugin instance

  const configuration = {
    sessionKey: '<session_key>', //session key from EMMA Dashboard
    debug: true
  };

  EMMA.startSession(configuration);

  // Start push with options. Options are only used for Android. iOS use default app icon and open default controller
  const pushOptions = {
    classToOpen: '${config_id}.MainActivity', //replace ${config_id} for id in config.xml file
    iconResource: 'notification' // icon added in config.xml file
  };

  EMMA.startPush(pushOptions);

  this.statusBar.styleDefault();
  this.splashScreen.hide();
});

Push

📑 Docs

English Spanish

📱 Example

See example project here.