All Projects → infobip → mobile-messaging-cordova-plugin

infobip / mobile-messaging-cordova-plugin

Licence: other
Mobile Messaging SDK plugin for Cordova projects

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language
swift
15916 projects
CSS
56736 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to mobile-messaging-cordova-plugin

Onesignal Cordova Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Stars: ✭ 214 (+1026.32%)
Mutual labels:  cordova, ionic, push-notifications
hms-cordova-plugin
This repo contains all of Cordova HMS plugins.
Stars: ✭ 78 (+310.53%)
Mutual labels:  cordova, push-notifications, huawei
ionic4-boilerplate
🚀 boilerplate for ionic4 with CI based on travis and fastlane. doc and example are provided
Stars: ✭ 25 (+31.58%)
Mutual labels:  cordova, ionic
Dianoia-app
Mobile (Ionic 3 - Angular 4) app about non-pharmaceutical activities and information for people with dementia.
Stars: ✭ 13 (-31.58%)
Mutual labels:  cordova, ionic
angular-cordova
Angular wrapper for Cordova
Stars: ✭ 21 (+10.53%)
Mutual labels:  cordova, ionic
capacitor-rate-app
Let users rate your app using native review app dialog for both Android and iOS.
Stars: ✭ 88 (+363.16%)
Mutual labels:  cordova, ionic
hms-push-serverdemo-java
Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
Stars: ✭ 39 (+105.26%)
Mutual labels:  push-notifications, huawei
hms-push-serverdemo-php
PHP sample code encapsulates APIs of the HUAWEI Push Kit server.It provides many sample PHP programs about quick access to HUAWEI Push Kit for your reference or usage.
Stars: ✭ 21 (+10.53%)
Mutual labels:  push-notifications, huawei
Cordova Ionic Phonegap Branch Deep Linking Attribution
The Branch Cordova Ionic Phonegap SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
Stars: ✭ 228 (+1100%)
Mutual labels:  cordova, ionic
cordova-plugin-amap
Amap Maps plugin for Cordova
Stars: ✭ 51 (+168.42%)
Mutual labels:  cordova, ionic
cordova-plugin-exoplayer
Media player plugin for Cordova that uses Google's ExoPlayer
Stars: ✭ 48 (+152.63%)
Mutual labels:  cordova, ionic
ionic4-angular7-example
Ionic 4, Angular 7 and Cordova Tutorial: Build CRUD Mobile Apps
Stars: ✭ 57 (+200%)
Mutual labels:  cordova, ionic
haoshiyou-client
Source code for haoshiyou clients (Hybrid HTML5 App)
Stars: ✭ 14 (-26.32%)
Mutual labels:  cordova, ionic
Ews Javascript Api
EWS API for TypeScript/JavaScript - ported from OfficeDev/ews-managed-api - node, cordova, meteor, Ionic, Electron, Outlook Add-Ins
Stars: ✭ 241 (+1168.42%)
Mutual labels:  cordova, ionic
cordova-plugin-android-window-background
Simple Cordova plugin to set Android window background on start-up 🎨 🍭
Stars: ✭ 15 (-21.05%)
Mutual labels:  cordova, ionic
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (+1142.11%)
Mutual labels:  cordova, ionic
ionic4-image-crop-upload
Ionic 4, Angular 7 and Cordova Crop and Upload Image
Stars: ✭ 16 (-15.79%)
Mutual labels:  cordova, ionic
Wooionic3
An eCommerce App for WooCommerce stores using Ionic 3.
Stars: ✭ 208 (+994.74%)
Mutual labels:  cordova, ionic
OneSignal-Ionic-Sample
No description or website provided.
Stars: ✭ 85 (+347.37%)
Mutual labels:  ionic, push-notifications
ionic3-angular4-sample-app
Sample app of Ionic 3 and Angular 4
Stars: ✭ 35 (+84.21%)
Mutual labels:  cordova, ionic

Mobile Messaging SDK plugin for Cordova

npm

Mobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of Infobip IP Messaging Platform. The document describes library integration steps for your Cordova project.

Requirements

  • Cordova 11.0.0 (sudo npm install -g cordova)
  • npm (tested with 7.6.0)
  • node (tested with 15.11.0)

For iOS project:

  • Xcode 13.4.1
  • Carthage >= 0.37.0 (brew install carthage)
  • Minimum deployment target 12.0
  • Ruby version 2.3.8

For Android project:

  • Android Studio
  • Minimum API Level: 14 (Android 4.0 - Ice Cream Sandwich)

For Huawei:

  • Android Studio
  • Installed AppGallery with HMS Core at device
  • Minimum API level: 19 (Android 4.4 - KitKat)

Quick start guide

This guide is designed to get you up and running with Mobile Messaging SDK plugin for Cordova:

  1. Make sure to setup application at Infobip portal, if you haven't already.

  2. Add MobileMessaging plugin to your project, run in terminal:

    $ cordova plugin add com-infobip-plugins-mobilemessaging --save

    You can add typings if you are using TypeScript in yours project

    npm install --save-dev @types/mobile-messaging-cordova
    expand to see Ionic code

    ionic cordova plugin add com-infobip-plugins-mobilemessaging --save
    npm install @ionic-native/mobile-messaging --save

  3. Configure platforms

    1. iOS: Integrate Notification Service Extension into your app in order to obtain:
      • more accurate processing of messages and delivery stats
      • support of rich notifications on the lock screen
    2. Android: add Firebase Sender ID via plugin variable in config.xml :
    <plugin name="com-infobip-plugins-mobilemessaging" spec="...">
        <variable name="ANDROID_FIREBASE_SENDER_ID" value="Firebase Sender ID" />
    </plugin>

    Do not add "ANDROID_FIREBASE_SENDER_ID" variable if you're using Google Services Gradle Plugin and google-services.json, check How To in this case.

  4. Configure Huawei build

    1. Configure Huawei application

    2. Change plaform/android/build.gradle at the begging

          
          buildscript {
              repositories {
                  mavenCentral()
                  google()
                  jcenter()
                  maven { url 'https://developer.huawei.com/repo/' } // Added
              }
          
              dependencies {
                  classpath 'com.android.tools.build:gradle:3.3.0'
                  classpath 'com.huawei.agconnect:agcp:1.2.1.301' // Added
              }
          }
      
          allprojects {
              repositories {
                  google()
                  jcenter()
                  maven {url 'https://developer.huawei.com/repo/'} // Added
              }
              ...
          }
      
    3. Change plaform/android/app/build.gradle at the begging

          apply plugin: 'com.android.application'
          apply plugin: 'com.huawei.agconnect' // Added
          
          dependencies {
                 implementation 'com.huawei.hms:push:5.0.0.300'
                 implementation('com.huawei.hms:location:5.0.0.300') // Add it if you will use Geofencing feature
          }
      
    4. Sign your app to provide config for Generated Signing Certificate Fingerprint at previous step. You can change plaform/android/app/build.gradle or write sign config to build.json

         android {
      
             signingConfigs {
                 release {
                     storeFile file(<path to *.jks file>)
                     storePassword "<password>"
                     keyAlias "<alias>"
                     keyPassword "<password>"
                 }
             }
             buildTypes {
                 release {
                     signingConfig signingConfigs.release
                 }
                 debug {
                     signingConfig signingConfigs.release
                 }
             }
      
             ...
      
    5. Download agconnect-services.json from AppGallery Connect and copy it to platforms/android/app.

      a. Find your App from the list and click the link under Android App in the Mobile phone column.

      b. Go to Develop > Overview.

      c. In the App information area, Click agconnect-services.json to download the configuration file.

    6. Add Huawei App ID via plugin variable in config.xml :

      <plugin name="com-infobip-plugins-mobilemessaging" spec="...">
          <variable name="HUAWEI_SENDER_ID" value="Huawei App ID" />
      </plugin>

      You can take this value from agconnect-services.json.

    7. Run cordova build android --hms to make build for HMS.

      Note that if you are developing / testing FCM and HMS at the same device then better to remove cache for installed app, remove app and after that install build with other push cloud.

  5. Add code to your project to initialize the library after deviceready event with configuration options and library event listener:

    onDeviceReady: function() {
        ...
        MobileMessaging.init({
                applicationCode: '<your_application_code>',
                geofencingEnabled: '<true/false>',
                ios: {
                    notificationTypes: ['alert', 'badge', 'sound']
                },
                android: {
                    notificationIcon: <String; a resource name for a status bar icon (without extension), located in '/platforms/android/app/src/main/res/mipmap'>,
                    multipleNotifications: <Boolean; set to 'true' to enable multiple notifications>,
                    notificationAccentColor: <String; set to hex color value in format '#RRGGBB' or '#AARRGGBB'>
                }
            },
            function(error) {
                console.log('Init error: ' + error.description);
            }
        );
    
        MobileMessaging.register('messageReceived', 
            function(message) {
                console.log('Message Received: ' + message.body);
            }
        );
    
        ...
    }
    expand to see Ionic code

    Add this code to app.module.ts::

    import { MobileMessaging } from '@ionic-native/mobile-messaging/ngx';
    
    ...
    
    @NgModule({
     ...
    
      providers: [
        ...
        MobileMessaging
        ...
      ]
      ...
    })
    export class AppModule { }

    Usage sample:

    import {Message, MobileMessaging, UserData} from '@ionic-native/mobile-messaging/ngx';
    
    ...
    
    @Component({
      selector: 'app-root',
      templateUrl: 'app.component.html',
      styleUrls: ['app.component.scss']
    })
    export class AppComponent {
      constructor(
        private platform: Platform,
        private splashScreen: SplashScreen,
        private statusBar: StatusBar,
        private mobileMessaging: MobileMessaging
      ) {
        this.initializeApp();
      }
    
    ...
    
      this.mobileMessaging.init({
        applicationCode: '<your_application_code>',
        geofencingEnabled: '<true/false>',
        ios: {
          notificationTypes: ['alert', 'badge', 'sound']
        },
        android: {
          notificationIcon: <String; a resource name for a status bar icon (without extension), located in '/platforms/android/app/src/main/res/mipmap'>,
          multipleNotifications: <Boolean; set to 'true' to enable multiple notifications>,
          notificationAccentColor: <String; set to hex color value in format '#RRGGBB' or '#AARRGGBB'>
       }}, (err) => {
         ...
       });
     
       this.mobileMessaging.register('messageReceived').subscribe((message: Message) => {
         ...
       });

Initialization configuration

MobileMessaging.init({
        applicationCode: <String; Infobip Application Code from the Customer Portal obtained in step 2>,
        ios: {
            notificationTypes: <Array; values: 'alert', 'badge', 'sound'; notification types to indicate how the app should alert user when push message arrives>
        },
        android: { // optional
            notificationIcon: <String; a resource name for a status bar icon (without extension), located in '/platforms/android/app/src/main/res/mipmap'>,
            multipleNotifications: <Boolean; set to 'true' to enable multiple notifications>,
            notificationAccentColor: <String; set to hex color value in format '#RRGGBB' or '#AARRGGBB'>
        },
        geofencingEnabled: <Boolean; set to 'true' to enable geofencing inside the library>, // optional
        messageStorage: <Object; message storage implementation>, // optional
        defaultMessageStorage: <Boolean; set to 'true' to enable default message storage implementation>, // optional
        notificationCategories: [ // optional
           {
               identifier: <String; a unique category string identifier>,
               actions: [
                   {
                       identifier: <String; a unique action identifier>,
                       title: <String; an action title, represents a notification action button label>,
                       foreground: <Boolean; to bring the app to foreground or leave it in background state (or not)>,
                       textInputPlaceholder: <String; custom input field placeholder>,
                       moRequired: <Boolean; to trigger MO message sending (or not)>,
                                               
                       // iOS only
                       authenticationRequired: <Boolean; to require device to be unlocked before performing (or not)>,
                       destructive: <Boolean; to be marked as destructive (or not)>,
                       textInputActionButtonTitle: <String; custom label for a sending button>,
                       
                       // Android only
                       icon:
                        <String; a resource name for a special action icon>
                   }
               ]   
           }
        ],
        privacySettings: { // optional
            carrierInfoSendingDisabled: <Boolean; defines if MM SDK should send carrier information to the server; false by default>,
            systemInfoSendingDisabled: <Boolean; defines if MM SDK should send system information to the server; false by default>,
            userDataPersistingDisabled: <Boolean; defines if MM SDK should persist User Data locally. Persisting user data locally gives you quick access to the data and eliminates a need to implement the persistent storage yourself; false by default>
        }
    },
    function(error) {
        console.log('Init error: ' + error.description);
    }
);

More details on SDK features and FAQ you can find on Wiki


NEXT STEPS: User profile


If you have any questions or suggestions, feel free to send an email to [email protected] or create an issue.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].