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-acoustic-mobile-push-beta

v3.9.125

Published

Allows Cordova applications to integrate with Acoustic MCE Push Services

Downloads

76

Readme

Acoustic Campaign - Cordova Plugin

Campaign plugin has been published to NPM for Cordova apps. Add the plugin with 'npm' to start configuring basic or advanced mobile app messaging features using an unified configuration file called 'CampaignConfig.json' for both iOS and Android apps.

📘 Note:

Beta build plugin ends with '-beta' in the name of the package.

🚧 Warning:

To transmit sensitive information, encrypt the inbox, in-app, and mobile app messages data before sending it and decrypt the data in memory on the device.

Install Acoustic Campaign Cordova plug-in

  1. Add cordova-acoustic-mobile-push-beta from the project.
npm i cordova-acoustic-mobile-push-beta

Update CampaignConfig.json

After the plugin is installed, CampaignConfig.json file will be created if not found on the root of the project. Example screenshot of the file and the json properties:

For production Campaign SDKs, set "useRelease" to true, false uses beta build. Note: It's recommended to set the property to "false" during testing phase.

  "useRelease": true,

Set up your Android project

  1. For Android Campaign SDK version, update "androidVersion" if you need a version which is not the latest. Otherwise leave it blank to get the latest.
  "androidVersion": "x.x.x",
  1. Copy your google-services.json file with your Google-provided FCM credentials to your android project folder: platforms/android/app/google-services.json.
  2. Edit CampaignConfig.json file in android section and fill in the baseUrl and appKey provided by your account team.
"baseUrl": "https://mobile-sdk-lib-XX-Y.brilliantcollector.com",
"appKey": {
  "prod": "INSERT APP KEY HERE"
},
  1. Run node.js command from project's folder to automatically apply all updates in the json file
node node_modules/cordova-acoustic-mobile-push-beta/scripts/installPlugins.js
  1. Build Android application in cordova
cordova build android
  1. Launch Android app.
cordova run android

Set up your iOS project

📘 Note:

The iOS Simulator is unable to handle push messages.

  1. For iOS Campaign SDK version, update "iOSVersion" if you need a version which is not the latest. Otherwise leave it blank to get the latest.
  "iOSVersion": "x.x.x",
  1. Open the iOS project in Xcode.
  2. Fix up the bundle ID and signing to use a bundle ID and profile with appropriate capabilities.
  3. Add the Push Notification capability to your project: Go to Signing & Capabilities, Click **+Capability **, and select Push Notification.
  4. Turn on the Location Updates background mode to your project: Go to Signing & Capabilities and check Location Updates checkbox.
  5. Edit CampaignConfig.json file in iOS section and fill in the baseUrl and appKey provided by your account team.
"baseUrl": "https://mobile-sdk-lib-XX-Y.brilliantcollector.com",
"appKey": {
  "dev": "INSERT APP KEY HERE",
  "prod": "INSERT APP KEY HERE"
},
  1. Run node.js command from project's folder to automatically apply all updates in the json file
node node_modules/cordova-acoustic-mobile-push-beta/scripts/installPlugins.js
  1. Build iOS application in cordova
cordova build ios
  1. Launch Android app.
cordova run ios

Optional: Integrating the iOS notification service

The iOS notification service requires separate provisioning. This plug-in is required if you need to access push received events, dynamic action categories, and media attachments.

  1. Edit CampaignConfig.json file and set to true to cordova-acoustic-mobile-push-plugin-ios-notification-service-beta
"cordova-acoustic-mobile-push-plugin-ios-notification-service-beta": true,
  1. Run node.js command from project's folder to automatically apply all updates in the json file
node node_modules/cordova-acoustic-mobile-push-beta/scripts/installPlugins.js
  1. Build iOS application in cordova which will also update cocoapod depedencies.
cordova build ios
  1. Add a new Notification Service Extension target:
    a. In your XCode project, go to the File menu and select New > Target. A dialog box opens.
    b. In the dialog box, select iOS at the top and then select Notification Service Extension.
    c. Select Next, enter the extension name NewAppNotificationService, and choose **Objective-C **as
    Language.
    d. Click Finish. If a dialog box opens, select Activate. The new target is added to the project. Xcode created a new folder with files in it.
    e. Change the new target bundle identifier prefix and use .notification.
    f. Verify that the new target has the same iOS version as the application target. SDK minimum supported version is 13.0.
    g. Add the MceConfig.json file to the Notification Service target. Open the file and check the notification service target membership in the Target Membership of the File Inspector in the Xcode pane.
    h. Add -ObjC to the Other Linker Flags build options for the Notification Service.
    d. Add App Group capability to both your notification service extension and Application target. Be sure to use the same app group as the main application.
    e. Add the Keychain Sharing capability to both your notification service extension and Application target. Be sure to use the same value as the main application.
    f. Replace the contents of NotificationService.m and NotificationService.h with the following code:
// NotificationService.h
#import <UserNotifications/UserNotifications.h>
#import <AcousticMobilePushNotification/AcousticMobilePushNotification.h>

@interface NotificationService : MCENotificationService

@end
// NotificationService.m
#import "NotificationService.h"

@implementation NotificationService

@end

Add other Campaign features

  1. To add other features, update the 'plugins' section in the 'CampaignConfig.json' file. Below is default recommended settings:
 "plugins": {
    "Please note": "<true/false>, for cordova build.  True for release build, false for beta build",
    "useRelease": false,

    "Required Mobile-Push plugins": "<true/false>, enable or disable plugin",
    "cordova-acoustic-mobile-push-beta": true,
    "cordova-acoustic-mobile-push-plugin-ios-notification-service-beta": true,
    "cordova-acoustic-mobile-push-plugin-inapp-beta": true,
    "cordova-acoustic-mobile-push-plugin-inbox-beta": true,

    "Optional Mobile-Push plugins": "<true/false>, enable or disable plugin",
    "cordova-acoustic-mobile-push-plugin-action-menu-beta": true,
    "cordova-acoustic-mobile-push-plugin-beacon-beta": true,
    "cordova-acoustic-mobile-push-plugin-calendar-beta": true,
    "cordova-acoustic-mobile-push-plugin-dial-beta": true,
    "cordova-acoustic-mobile-push-plugin-displayweb-beta": true,
    "cordova-acoustic-mobile-push-plugin-geofence-beta": true,
    "cordova-acoustic-mobile-push-plugin-location-beta": true,
    "cordova-acoustic-mobile-push-plugin-passbook-beta": true,
    "cordova-acoustic-mobile-push-plugin-snooze-beta": true
  },
  1. Run node.js command to automatically install from project folder
node node_modules/react-native-acoustic-mobile-push/postinstall.js ./

Building the sample app

Instructions

Building on a new sample Cordova application

  1. Create your Cordova application based from https://cordova.apache.org/docs/en/latest/guide/cli/index.html
cordova create hello com.example.hello HelloWorld
  1. Move into application and add supported platforms for iOS and Android
cd hello
cordova platform add ios
cordova platform add android
  1. Additional setup for iOS, edit config.xml and adjust or add new minimal deployment target for iOS from iOS 11.0 to iOS 13.0 which is required for this plugin.
<platform name="ios">
    <preference name="deployment-target" value="13.0" />
</platform>

Example config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="co.acoustic.mobile.push.samples.android" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloCordova</name>
    <description>Sample Apache Cordova App</description>
    <author email="[email protected]" href="https://cordova.apache.org">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <platform name="ios">
        <preference name="deployment-target" value="13.0" />
    </platform>
</widget>
  1. Build app
cordova build
  1. Add https://www.npmjs.com/package/cordova-acoustic-mobile-push-beta plugin
npm i cordova-acoustic-mobile-push-beta
  1. Android setup, copy your google-services.json file with your Google-provided FCM credentials to your android project folder: platforms/android/app/google-services.json.

  2. Android setup, edit CampaignConfig.json file in android section and fill in the baseUrl and appKey provided by your account team.

  3. iOS setup, open your platforms/ios/HelloWorld.xcworkspace with Xcode

  4. iOS setup, fix up the bundle ID and signing to use a bundle ID and profile with appropriate capabilities.

  5. iOS setup, add the Push Notification capability to your project:

  • Go to Signing & Capabilities
  • Click +Capability
  • Select Push Notification
  1. iOS setup, turn on the Location Updates background mode to your project:
  • Go to Signing & Capabilities
  • check Location Updates checkbox
  1. iOS setup, edit CampaignConfig.json file in iOS section and fill in the baseUrl and appKey provided by your account team.

  2. iOS setup, run which will setup all the plugin options selected in CampaignConfig.json file

node node_modules/cordova-acoustic-mobile-push-beta/scripts/installPlugins.js
  1. iOS setup, run cordova to build with new plugins installed
cordova build