Installation

Installation instructions for Marketo Mobile SDK.  The steps below are required to send Push Notifications and/or In-App Messages.

How to Install Marketo SDK on iOS

Prerequisites

  1. Add an application in Marketo Admin (obtain your application Secret Key and Munchkin Id)
  2. Setup Push Notifications (optional)

Install Framework via CocoaPods

1. Install CocoaPods.
$ sudo gem install cocoapods
2. Change directory to your project directory and create a Podfile with smart defaults.
$ pod init
3. Open your Podfile.
$ open -a Xcode Podfile
4. Add the following line to your Podfile.
$ pod 'Marketo-iOS-SDK'
5. Save and close your Podfile.
6. Download and install Marketo iOS SDK.
$ pod install
7. Open workspace in Xcode.
$ open App.xcworkspace

Setup Swift Bridging Header

1. Go to File > New > File and Select “Header File”.

ResizedImage600351-Xcode-Choose-Header-File

2. Name the file “<ProjectName>-Bridging-Header”.

3. Go to Project > Target > Build Phases > Swift Compiler > Code Generation.  Add the following path to Objective-Bridging Header:

$(PODS_ROOT)/<ProjectName>-Bridging-Header.h

ResizedImage600323-build-phases

Initialize SDK

Before you can use the Marketo iOS SDK, you must initialize it with your Munchkin Account Id and App Secret Key. You can find each of these in the Marketo Admin area underneath “Mobile Apps & Devices”.

1. Open your AppDelegate.m file (Objective-C) or Bridging file (Swift) and import the Marketo.h header file.

2. Paste the following code inside the application:didFinishLaunchingWithOptions: function.





3. Replace munkinAccountId and secretKey above using your “Munchkin Account ID” and “Secret Key” which are found in the Marketo Admin > Mobile Apps & Devices section.

amobile2

iOS Test Devices

1. Select Project > Target > Info > URL Types.
2. Add identifier: ${PRODUCT_NAME}

Deep_Link_Settings

 

 

 

 

 

 

3. Set URL Schemes: mkto-<Secret Key>
4. Include application:openURL:sourceApplication:annotation: to AppDelegate.m file (Objective-C)

Handle Custom Url Type in AppDelegate





How to Install Marketo SDK on Android

Prerequisites

  1. Add an application in Marketo Admin (obtain your application Secret Key and Munchkin Id)
  2. Setup Push Notifications (optional)
  3. Download Marketo SDK for Android

Android SDK Setup

Setup Using Gradle

1. Open your project in android Studio

2. Right click on your project and select #Open Module Settings

3. Click on Project which is in the Left panel of the screen

4. In Android Plugin Repository add ‘https://github.com/Marketo/android-sdk/raw/preprod/

5. In Default Library Repository add ‘https://github.com/Marketo/android-sdk/raw/preprod/

6. Click OK

7. In the application level build.gradle file, under the dependencies section add

implementation ‘com.marketo:MarketoSDK:0.7.8’

8. Sync your Project with Gradle Files

Setup Using .AAR

1. Open your project in Android Studio.

doc-mobile-android-installation-open-project

2. Right-click on your project and select “Open Module  Settings”.

doc-mobile-android-installation-open-module-settings

3. Click on the plus button “+” in the top left corner.

doc-mobile-android-installation-open-project-plus-button

4.  Select “Import .JAR/.AAR package” and click “Next”.

doc-mobile-android-installation-import-package

5.  Click the ellipses button  “..” and select the location of the .aar file from Marketo Android SDK.

doc-mobile-android-installation-select-aar-file

6. You can change the name of the SubProject and click “Finish”.

doc-mobile-android-installation-name-subproject

7. Right-click on your project and select “Open Module Settings”.

doc-mobile-android-installation-open-module-settings-again

8. Select your project name in “Modules” and click on the “Dependencies” tab.

doc-mobile-android-installation-modules-dependencies

9. Click on the plus button “+” (at the bottom on Mac, at top corner on Windows) and select “Module dependency”.

doc-mobile-android-installation-modules-dependency-select

10.  Select the SubProject name from  Step 6.

doc-mobile-android-installation-subproject-select

11. Click “OK” and let Gradle sync the project and resolve the dependency.

doc-mobile-android-installation-gradle-resolve-dependency

12. When Gradle sync is complete, it will show you the following info in Gradle Console.

doc-mobile-android-installation-gradle-console

Configure Permissions

Open AndroidManifest.xml and add following permissions. Your app must request the “INTERNET” and “ACCESS_NETWORK_STATE” permissions. If your app already requests these permissions, then skip this step.


Initialize SDK

1. Open the Application or Activity class in your app and import the Marketo SDK into your Activity before setContentView or in Application Context.



2. (DEPRECATED Remove this code when updating to v0.7.6) Configure activities. Add Marketo.onStart(), Marketo.onStop() in all or in base activity as shown below.



3.  ProGuard Configuration (Optional)

If you are using ProGuard for your app, then add the following lines in your proguard.cfg file. The file will be located within your project folder. Adding this code will exclude the Marketo SDK from the obfuscation process.



Android  Test  Devices

Add “MarketoActivity” to AndroidManifest.xml file inside application tag.



Firebase Cloud Messaging Support

The MME Software Development Kit (SDK) for Android has been updated to a more modern, stable and scalable framework that contains more flexibility and new engineering features for your Android app developer.

Android app developers can now directly use Google’s Firebase Cloud Messaging (FCM) with this SDK.

IMPORTANT: This exciting update will not require your current mobile app users to download a new version of your app, BUT any new app users who download your app after March 31, 2018 will not be able to receive push notifications until you update to the latest version of the SDK.

We will continue to support the previous SDK version until March 31, 2019.  Instructions for your Android App Developer: HERE

Adding FCM to your Application

  1. Integrate latest Marketo Android SDK in Android App.  Steps are available at GitHub.
  2. Configure Firebase App on Firebase Console.
    1. Create/Add a Project on Firebase Console.
      1. In the Firebase console, select Add Project.
      2. Select your GCM project from the list of existing Google Cloud projects, and select Add Firebase.
      3. In the Firebase welcome screen, select Add Firebase to your Android App.
      4. Provide your package name and SHA-1, and select Add App. A new google-services.json file for your Firebase app is downloaded.
      5. Select Continue and follow the detailed instructions for adding the Google Services plugin in Android Studio.
    2. Navigate to ‘Project Settings’ in Project Overview
      1. Click on ‘General’ tab. Download the ‘google-services.json’ file.
      2. Click on ‘Cloud Messaging’ tab. Copy ‘Server Key’ & ‘Sender ID’. Provide these ‘Server Key’ & ‘Sender ID’ to Marketo.
    3. Configure FCM changes in Android App
        1. Switch to the Project view in Android Studio to see your project root directory
        2. Move the downloaded ‘google-services.json’ file into your Android app module root directory
        3. In Project-level build.gradle add the following:
        4. In App-level build.gradle add the following:
        5. Finally, click on “Sync now” in the bar that appears in the ID
    4. Edit your app’s manifest
      The FCM SDK automatically adds all required permissions as well as the required receiver funtionality. Make sure to remove the following obsolete (and potentially harmful, as they may cause message duplication) elements from your app’s manifest:

       

FCM FAQ

Frequently asked questions regarding Firebase Cloud Messaging support.

Q: Where can I find instructions to update to the latest version of the MME SDK?
Instructions can be found on the Marketo Developer Site HERE.

Q: Will updating to the latest version of the SDK require me to publish an updated version of my Android Application to my existing users?
No.

Q: What happens if I don’t upgrade to the latest version of the MME SDK by March 31, 2019?
Existing App Users: Your existing app users will still receive push notifications.
New App Users: Any new app user who downloads your application after March 31, 2019 will not receive push notifications until you update to the latest version of the SDK.

Q: Why do we need to migrate from GCM to FCM for Android?
Google is investing in Firebase, making it our unified mobile platform. Since it was added to Firebase at Google I/O in 2016, FCM has been the recommended replacement for GCM.

Q: What are our target timelines for migration?
Google will turn off GCM service in April 2019, so you should plan to have GCM service migrated by then.
Note: Client SDKs and GCM tokens will continue to work indefinitely.

Q: How does it impact the existing MME customers that have published Android Apps integrated with Marketo Android SDK?
They can migrate an existing GCM client app on Android to Firebase Cloud Messaging (FCM) as follows:

  1. In the Firebase console, select Add Project.
  2. Select your GCM project from the list of existing Google Cloud projects, and select Add Firebase.
  3. In the Firebase welcome screen, select Add Firebase to your Android App.
  4. Provide your package name and SHA-1, and select Add App. A new google-services.json file for your
  5. Firebase app is downloaded.
  6. Select Continue and follow the detailed instructions for adding the Google Services plugin in Android Studio.

Q: Once the FCM support is released in Q4, till when can we continue to support existing Android Apps that have not upgraded to latest SDK?
We will continue to support till March 31, 2019. Then after you must need to use latest SDK and need to migrate from GCM to FCM.

Q: Can the Google GCM App Created on Google Cloud Console be used For FCM Push notification?
Yes, For now we can use the GCM App Created on Google Cloud Console. But As of April 10, 2018, Google will deprecate GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features.

Q: Can we target the leads created using the old Marketo SDK which used GCM App ?
Yes. All the leads created using Marketo SDK can be targeted for sending the push notifications.