Skip to content

Instantly share code, notes, and snippets.

-keep class com.sessionm.api.** { *; }
-keep class com.sessionm.net.http.DownloadService { *; }
-keep class com.sessionm.ui.** { *; }
dependencies {
//Required
compile 'com.sessionm.sdk:sessionm-sdk:1.11.6'
//Optional
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.okhttp:okhttp:2.6.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
allprojects {
repositories {
maven { url 'http://maven.sessionm.com/public' }
}
}
@sessionm-docs
sessionm-docs / AndroidManifest.xml
Created February 23, 2016 17:44
MMC - Geofence integration
<!-- Geofence requires location permission -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Keeps the processor from sleeping when a geofence event is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Add geofence service inside application block -->
<application>
<service android:name="com.sessionm.api.enterprise.GeofenceIntentService" />
</application>
@sessionm-docs
sessionm-docs / geofence.h
Created February 23, 2016 17:43
MMC - Geofence integration
// Ensure app Background Modes are enabled for Location updates and Background fetch in the Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>location</string>
</array>
// Then ensure at least the Key for NSLocationAlwaysUsageDescription is present:
<key>NSLocationAlwaysUsageDescription</key>
<string></string>
@sessionm-docs
sessionm-docs / ExampleApp.java
Last active February 23, 2016 16:20
MMC - Push Integration
//
// In your LAUNCHER activity
// MyApp
//
//
public class BaseActivity extends Activity implements SessionListener {
MessageData messageData;
@Override
protected void onCreate(Bundle savedInstanceState) {
@sessionm-docs
sessionm-docs / ExampleAppDelegate.m
Last active February 23, 2016 16:14
MMC - Push Integration
//
// ExampleAppDelegate.m
// MyApp
//
//
#import "ExampleAppDelegate.h"
#import "SessionM.h"
@implementation ExampleAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
@sessionm-docs
sessionm-docs / AndroidManifest.xml
Created February 23, 2016 15:56
MMC - Enable Push
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Creates a custom permission so only this app can receive its messages. NOTE: the permission *must* be called PACKAGE.permission.C2D_MESSAGE, where PACKAGE is the application's package name.-->
<permission android:name="com.sessionm.entouragedemo.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
@sessionm-docs
sessionm-docs / enable-push.h
Created February 23, 2016 15:55
MMC - Enable Push
// Ensure app Background Modes are enabled for Remote notifications and Background fetch in the Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>remote-notification</string>
</array>
// When you want to request permission for remote notifications call:
[[SessionM sharedInstance] registerForRemoteNotifications];
@sessionm-docs
sessionm-docs / sessionm-ui.java
Created February 23, 2016 15:45
MMC - SessionM UI
List<MessageData> messagesList = SessionM.getInstance().getMessagesList();
@Override
public View getView(int position, View convertView, ViewGroup parent) {
FeedViewHolder feedViewHolder;
if (imageLoader == null)
imageLoader = MessageUtil.getInstance(activity).getImageLoader();