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

@anagog/cordova-jedai

v1.13.0

Published

Anagog SDK Cordova plugin. Use our Cordova plugin to integrate our SDK in your Cordova apps.

Downloads

108

Readme

Integration

Cordova

cordova plugin add @anagog/cordova-jedai

iOS

Requirements

  • Xcode version 13.0 or later.
  • iOS version 11.0 or later.

Note: Xcode/Swift version - depends on SDK version. SDKs are always built with the latest Xcode version at the time of the release. If you need the SDK built to a specific version please contact Anagog Customer Support and we will provide it.

Info.plist

  • Add API key that you received from Anagog.
<key>ANAGOG_API_KEY</key>
<string>PUT HERE YOUR API KEY</string>

Android

Requirements

  • compileSdkVersion: 31
  • targetSdkVersion: 30
  • minSdkVersion: 21

In Cordova you should can set these values in gradle.properties

  • cdvSdkVersion = 31
  • cdvMinSdkVersion = 21
  1. SDK Configuration in AndroidManifest.xml
    • Set SDK License Key
    • Foregraound service notification title string resourse
    • Foreground service notification message setring resourse
    • Foreground service notification icon resourse

AndroidManifest.xml


<application
        android:name=...
        android:theme="@style/AppTheme">

        <meta-data android:name="ANAGOG_API_KEY"
            android:value="api key as received from Anagog"/>

        <!-- The following 3 elements required if your app needs location services -->

        <meta-data android:name="ANAGOG_NOTIFICATION_ICON"
            android:resource="@mipmap/ic_launcher"/> 

        <meta-data android:name="ANAGOG_FOREGROUND_TITLE"
            android:resource="@string/anagog_foreground_title"/>

         <meta-data android:name="ANAGOG_FOREGROUND_MESSAGE"
            android:resource="@string/anagog_foreground_title"/>   
    </application>
  1. Define foreground service string resources

strings.xml

<resources>
    ...
    <string name="anagog_foreground_title">notification title</string>
    <string name="anagog_foreground_message">notification body</string>

</resources>
  1. SDK Config json file When installing Anagog Cordova plugin, it will add a default anagog_config.json file in android/app/src/main/assets directory This file can be used to configure essentials features in the SDK
    • Open anagog_config.json file in project android/app/src/main/assets directory
    • Set your preferred configuration
    • The file structure should be like this:

android/app/src/main/assets/anagog_config.json

{
    "userDefinedStats": {
       "StringUserDefinedStat" : "STRING", //Set a String type CustomMicroSegment
       "IntegerUserDefinedStat" : "INTEGER", //Set an Integer type CustomMicroSegment
       "DecimalUserDefinedStat" : "DECIMAL", //Set a Decimal type CustomMicroSegment
    },
    "notificationChannelId": "", //Fill with your own app channel name
    "foregroundChannelId": "", //Fill with your own app channel name
    "enableAudienceAnalytics" : true,
    "foregroundMode" : "NEVER", //Available values: NEVER, ON_DEMAND, ALWAYS
    "enableLatestMs": true,
    "enableCrashReports": true,
    "enableInternalLog" : true,
    "jedaiAutoEnabled" : true 
  }

Usage

SDK Notifications

AnagogCordova.obtainEventStream((action, payload) => {
	switch (action) {
		case AnagogEventType.onCampaignTriggered: {
			break;
		}
		case AnagogEventType.onNotificationClick: {
			var identifier = payload["campaign_identifier"];
			console.log('onNotificationClick Campaign Identifier:', identifier);
			break;
		}
		case AnagogEventType.onSnapshotReport: {
			break;
		}
		case AnagogEventType.onJedAIStatusChange: {
			if (payload == JedAIStatus.active)
				console.log('JedAI is active');
			else if (payload == JedAIStatus.passive)
				console.log('JedAI is not running');
			break;
		}
	}
});

Campaigns

Note: Please do not use those APIs in production

// Download
AnagogCordova.syncCampaigns()

// Simulate
AnagogCordova.simulateCampaign() // - all
AnagogCordova.simulateCampaign('campaignId') // - specific

// Get all available campaigns
AnagogCordova.getCampaigns(campaigns => {
    // `campaigns` is a list of objects
})

Microsegments

// Fetch values
AnagogCordova.getUserDefinedString('name', (name) => {
    // `name` is a string value
})
AnagogCordova.getUserDefinedInteger('age', (age) => {
    // `age` is a number value
})
AnagogCordova.getUserDefinedDecimal('score', (score) => {
    // `score` is a number value
})

// Set values
AnagogCordova.setUserDefinedString('name', 'Alesander');
AnagogCordova.setUserDefinedInteger('age', 67);
AnagogCordova.setUserDefinedDecimal('score', 97.5);

Micromoments

let micromoment = new ApplicationEvent('Registration');
micromoment.addTextParameter('Status', 'Completed');
AnagogCordova.fireMicromoment(micromoment);

You can fire micromoment also this way:

let micromoment = new ApplicationEvent('Registration');
micromoment.addTextParameter('Status', 'Completed');
micromoment.fire();

Reports

// Force schedule reports
AnagogCordova.forceScheduleReports();

//Request microsegments snapshot report
AnagogCordova.requestMicrosegmentsSnapshotReport();

JedAI

// Get JedAI status
AnagogCordova.getJedAIStatus(status => {
    // Status may be `JedAIStatus.active` or `JedAIStatus.passive`
});

// Share feedback
AnagogCordova.share();

// Get JedAI SDK Version
AnagogCordova.getVersion(jedaiVersion => {
    // `jedaiVersion` is a string
})

License

Anagog SDK is not open source software or public software. It is the proprietary software of Anagog Ltd. and, unless otherwise agreed in writing with Anagog Ltd., no rights are granted to you in respect of the SDK. This SDK is subject to, and may only be used in accordance with the terms of (and obligations imposed by) a separate commercial license agreement with Anagog Ltd.

You may not copy or use this SDK in any manner without first entering into an agreement with and obtaining a license from Anagog Ltd.

In order to request a license to use this SDK and an activation key from Anagog Ltd., please contact Anagog Ltd. directly at [email protected].

Anagog Ltd. reserves the right, in its sole discretion, to grant or reject requests for licenses to this SDK.