Marketo Mobile SDK for PhoneGap
The Marketo Mobile SDK allows integration with Marketo Mobile Engagement (MME).
Plugin Change Log
v0.7.8 (Dec 10, 2018)
- Added Support for Firebase Cloud Messaging in Android
- Fixed Bugs
v0.7.7 (May 25, 2018)
- Added Support for Android API Level P (28)
- Fixed Bugs
v0.7.6 (February 12, 2018)
- Updated Android framework
- Using Android Activity Lifecycle Callbacks
v0.7.5 (January 4, 2018)
- Updated iOS bundle and framework
- Minimum supported Cordova CLI version: 7.1.0
iOS Change Log
v0.7.6 (September 4, 2018)
- Fixed tap gesture error at In-app
v0.7.5 (September 8, 2017)
- Fixed build errors and warnings in xCode 9
v0.7.4 (July 7, 2017)
- Exposed removeDevicePushToken() method
v0.7.1 (November 24, 2016)
- Handling notification in loadingOptions for iOS 10 to track tap activity when app is closed.
v0.7.0 (October 5, 2016)
- Using UNNotification to handle push received while app is in foreground with a local notification
v0.6.4 (August 23, 2016)
- Exposed method [MarketoSDK reportAll] to immediately send events
v0.6.3 (July 15, 2016)
- Support for InApp display frequnecy once.
v0.6.0 (June, 11 2016)
- InApp Notifications
v0.5.1 - v0.5.3
- Fixed new_install bug
- Fix for version bug
v0.5.0
- Advanced secure access
- Bitcode refactor
Android Change Log
v0.7.6 (January 18, 2018)
- Added support for Android API Levels 26 and 27
- Using Android Activity Lifecycle Callbacks
- Deprecated Marketo.onStart() and Marketo.onStop(), no longer required
- The minimum supported Android API Level is now 14
v0.7.5 (July 7, 2017)
- Fixed bug
v0.7.3 - v0.7.4 (July 7, 2017)
- Exposed removeDevicePushToken() method
- Notifications are now dismissed from the notification center after tap (Android 4.0)
- Custom large notification icon no longer shows default image (Android 4.0)
v0.7.2 (November 30, 2016)
- Fixed bug when using Priority method in Android versions previous to 5.0
- Default sound in Android is now on when user receives a notification
- Android Push Notification text now wrap to make it more readable
- Migrated from HttpClient to HttpURLConnection
v0.7.1 (November 4, 2016)
- Remove GET_ACCOUNTS permission check
- No longer stacking push notifications
- Catching client protocol exception
v0.7.0 (October 13, 2016)
- Supporting Android Version 7.0
v0.6.4 (August 22, 2016)
- Exposed method [MarketoSDK reportAll] to immediately send events
v0.6.3 (July 15, 2016)
- Bug fixes related to inapp
- added display frequency 'once'
v0.6.0 (June 10, 2016)
- InApp Notifications
v0.5.3
- Fixed bug that stop push notification when app was closed
v0.5.2
- Removed depricated android methods to allow building with Proguard
v0.5.1
- Fixed intent.getAction condition
v0.5.0
- New secure access feature
- New app type selection
- Android notificaiton config large icon
Contributing Code
We accept pull requests! Please raise a merge request.
Issues
If you encounter issues using or integrating this plugin, please file a support ticket at support.marketo.com
Marketo PhoneGap Plugin Installation Guide
Prerequisites
- Register an application in Marketo Admin portal, get your application secret key and munchkin id.
- Configure Android Push access learn here
- Configure iOS Push access learn here
Setup Marketo PhoneGap plugin
- Install Marketo PhoneGap Plugin using PhoneGap/Cordova CLI (Minimum supported version: 7.1.0): Please follow below steps or ensure you have latest cordova version installed on the system learn more
- Once it’s ready go to your PhoneGap application directory and run following command.
cordova plugin add https://github.com/Marketo/PhoneGapPlugin.git --variable APPLICATION_SECRET_KEY="YOUR_APPLICATION_SECRET"
Migrate to newer version
// This command will remove existing marketo plugincordova plugin remove commarketoplugin // This command will add it again.cordova plugin add https://github.com/Marketo/PhoneGapPlugin.git --variable APPLICATION_SECRET_KEY="YOUR_APPLICATION_SECRET"
This will add Marketo Plugin into your phonegap application.
Cordova version 8.0.0 (Cordova@Android7.0.0) and above
Once the Cordova Android platform is built, open the app with Android Studio and update the dirs value of the -Marketo.gradle file found in the com.marketo.plugin folder.
repositories flatDir dirs '../app/src/main/aar'
Track Push Notifications
- Paste the following code inside the application:didFinishLaunchingWithOptions: function.
Objective-C
Marketo *sharedInstance = [Marketo sharedInstance];[sharedInstance trackPushNotification:launchOptions];
Swift
let sharedInstance: Marketo = Marketo.sharedInstance()sharedInstance.trackPushNotification(launchOptions)
Initialize Marketo Framework
- After successful installation, you need to initialize Marketo framework.
- Open your main js file and Add the following code under “onDeviceReady: function()”.
// This method will Initialize the Marketo Framework using Your MunchkinId and secret keymarketo; // For session tracking, please add following.marketo;
Initialize Marketo Push Notification :
- After Initializing Marketo SDK successfully , you need to setup push notification.
- Open your main js file and Add the following code under “onDeviceReady: function()” after marketo.initialize function.
// This function will Enable user notifications (will prompt the user to accept push notifications in iOS)marketo;
Note: You can get your GCM Project ID from Google Developer Console https://console.developers.google.com/
The token can also be unregistered when user logs out.
marketo;
Marketo Associate Lead:
- You can create a Marketo Lead by calling associate lead method.
// First create a lead as below var lead_obj = {}; lead_objmarketoKEY_FIRST_NAME= "John"; lead_objmarketoKEY_LAST_NAME= "Erickson"; lead_objmarketoKEY_EMAIL= "johnE@marketo.com"; lead_objmarketoKEY_ADDRESS= "901 Mariners Island Boulevard"; lead_objmarketoKEY_CITY= "San Mateo"; lead_objmarketoKEY_STATE= "CA"; lead_objmarketoKEY_COUNTRY= "USA"; lead_objmarketoKEY_POSTAL_CODE= "94404"; lead_objmarketoKEY_GENDER= "Male"; // Use associate function to associate it. marketo;
Marketo Report Action:
- You can report any user performed action by calling the reportaction method.
// First create an event as below var event = "Action Type":"Add To Cart" "Action Details":"Adding Product in cart" "Action Metric":"10" "Action Length":"1" marketo;
Marketo Report All Actions:
- You can report any user performed action by calling the reportaction method.
marketo;
Marketo session reporting
- Bind pause and resume events as show below to report Start and stop to track time spent in mobile application.(Note this is required in android) .
//Add the following code in your www/js/index.js { document; document; document; } { marketo; } { marketo; }