Leanplum comes with a number of in-app messaging templates, including alerts, confirmation screens, popups, and full-screen interstitials. They are open source, so you can customize them however you want, and you can even create your own templates.
To enable in-app messaging, you'll need to integrate the Leanplum SDK and run your app at least once in development mode.
On the dashboard, you can set in-app messages to automatically appear when certain events occur or when the app starts. These events must be tracked with our SDK. There's no additional coding needed.
To setup push notification support, Leanplum provides a couple of built-in methods that will help you.
On iOS, use the following code to register your app for remote notifications after Leanplum starts. This simply registers through the iOS framework for alerts, badges, and sounds.
Alternatively, if you want to register in a custom way, you can add the registration code in your Objective-C code.
For iOS, you'll also need to upload your certificates to Leanplum. Refer to the iOS SDK documentation for instructions.
On Android, you need to setup your Google Cloud Messaging sender ID. You can do this in C# or in Java. Leanplum provides a built-in sender ID, or you can use your custom ID. Make sure that the sender ID or IDs you pass to Leanplum are consistent with those used anywhere else in your app, including with other third party SDKs. If you do not, then this could prevent your users from receiving some notifications. Use one of the following before Leanplum starts:
// Use the built-in sender ID. Leanplum.SetGcmSenderId(Leanplum.LeanplumGcmSenderId); // Use your own sender ID. Leanplum.SetGcmSenderId("123456790abcdef"); // Use both sender IDs, for ex. if you want Leanplum to send notifications through Leanplum's ID // and your own server to send notifications through your own ID. Leanplum.SetGcmSenderIds("123456790abcdef", Leanplum.LeanplumGcmSenderId);
If you're using your own sender ID, you need to give Leanplum permission to send notifications on your behalf. Simply paste your Google API key (this is different from your sender ID) in your app's Push Notification settings.
On Android, you'll also need to add some items to your manifest. Refer to the Android SDK setup for the appropriate code.
It's a good practice to show additional information or navigate to the correct part of your app when users open your push notifications. You can do that using Leanplum's in-app messaging, which integrates nicely with push notifications. There's no additional coding needed.
Test Push Notifications
Once you've set up push notifications, test that it is working properly. Send a push notification to your development devices.
You can set up geofence and iBeacon regions as criteria to trigger in-app messages and push notifications, right from the dashboard. Refer to the iOS SDK documentation and Android SDK documentation for more information.
Custom In-App Messaging Templates
The built-in in-app messaging templates are open-source. You can modify them, delete them, or create your own. The dashboard will reflect your new templates the next time you run your app. Currently, you can only do this in the native iOS and Android code. Refer to the iOS SDK documentation and Android SDK documentation for more information.