├── PayWithAmazon ├── .gitignore └── build.gradle ├── settings.gradle ├── app ├── .gitignore ├── keystore │ └── debug.keystore ├── src │ └── main │ │ ├── assets │ │ └── fonts │ │ │ ├── Light.ttf │ │ │ ├── Medium.ttf │ │ │ └── Regular.ttf │ │ ├── res │ │ ├── raw │ │ │ └── notification_sound.mp3 │ │ ├── mipmap-xhdpi │ │ │ └── ic_demo_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_demo_launcher.png │ │ ├── drawable-nodpi │ │ │ └── notification_small.png │ │ ├── xml │ │ │ └── demo_provider_paths.xml │ │ ├── drawable │ │ │ ├── offer_menu_circle_bg.xml │ │ │ └── ic_local_offer.xml │ │ ├── menu │ │ │ └── client_menu.xml │ │ ├── values │ │ │ ├── styles.xml │ │ │ ├── colors.xml │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── view_offers_menu_item.xml │ │ │ └── activity_client_home.xml │ │ ├── java │ │ └── ai │ │ │ └── haptik │ │ │ └── android │ │ │ └── sample │ │ │ └── app │ │ │ ├── AppApplication.java │ │ │ ├── Utils.java │ │ │ ├── MyFirebaseMessagingService.java │ │ │ └── ClientHomeActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat ├── gradlew └── LICENSE /PayWithAmazon/.gitignore: -------------------------------------------------------------------------------- 1 | *.aar 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | google-services.json 3 | -------------------------------------------------------------------------------- /app/keystore/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/keystore/debug.keystore -------------------------------------------------------------------------------- /PayWithAmazon/build.gradle: -------------------------------------------------------------------------------- 1 | configurations.maybeCreate("default") 2 | artifacts.add("default", file('PayWithAmazon27-07-18.aar')) -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/assets/fonts/Light.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/assets/fonts/Medium.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/assets/fonts/Regular.ttf -------------------------------------------------------------------------------- /app/src/main/res/raw/notification_sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/res/raw/notification_sound.mp3 -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_demo_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/res/mipmap-xhdpi/ic_demo_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_demo_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/res/mipmap-xxhdpi/ic_demo_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/notification_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/haptiklib-demo/master/app/src/main/res/drawable-nodpi/notification_small.png -------------------------------------------------------------------------------- /app/src/main/res/xml/demo_provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/offer_menu_circle_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 11 20:42:43 IST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip -------------------------------------------------------------------------------- /app/src/main/res/menu/client_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | build/ 16 | 17 | # Local configuration file (sdk path, etc) 18 | local.properties 19 | 20 | # Windows thumbnail db 21 | .DS_Store 22 | 23 | # Android Studio captures folder 24 | captures/ 25 | 26 | # Keystore files 27 | *.jks 28 | 29 | # IDEA/Android Studio project files, because 30 | # the project can be imported from settings.gradle 31 | *.iml 32 | .idea/* 33 | 34 | # Gradle cache 35 | .gradle -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_local_offer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #7ECC81 4 | #484804 5 | #FF4081 6 | @color/colorAccent 7 | @color/colorPrimary 8 | #967ecc81 9 | @color/colorPrimaryDark 10 | #832e2e 11 | #e9e998 12 | 13 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/jigar/Development/adt-bundle-mac-x86_64-20131030/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | -dontwarn okio.** -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Haptik SDK Demo 3 | Unread Chats : %d 4 | Logout 5 | This page imitates potential main screen of client app 6 | Launch Haptik Chat Screen 7 | Logout Success! 8 | Logout failure! 9 | Launch Signup 10 | Haptik SDK Signup 11 | YOUR CLIENT ID 12 | ENTER YOUR SHARE TEXT HERE 13 | ENTER YOUR SHARE LINK HERE 14 | -------------------------------------------------------------------------------- /app/src/main/java/ai/haptik/android/sample/app/AppApplication.java: -------------------------------------------------------------------------------- 1 | package ai.haptik.android.sample.app; 2 | 3 | import ai.haptik.android.sdk.HaptikLib; 4 | import ai.haptik.android.sdk.InitData; 5 | import ai.haptik.android.sdk.InitDataCallback; 6 | import android.app.Application; 7 | 8 | /** 9 | *

10 | * InitDataCallback: use this interface to configure the InitData for Haptik SDK in case you do not want to initialize the Haptik SDK 11 | * in Application class. 12 | *

13 | */ 14 | 15 | public class AppApplication extends Application implements InitDataCallback { 16 | 17 | @Override 18 | public void onCreate() { 19 | super.onCreate(); 20 | HaptikLib.init(Utils.getHaptikInitData(this)); 21 | } 22 | 23 | @Override 24 | public InitData getClientSetupData() { 25 | return Utils.getHaptikInitData(this); 26 | } 27 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### Things to do before Before you can compile and run the app 2 | 3 | - Checkout `build.gradle` of the `root` project, and note that you need 4 | to add `maven` url for `Haptik SDK`. 5 | - Checkout `string-haptik.xml` file in resource. Get `clientId`, and 6 | `baseUrl` from `Haptik` 7 | 8 | #### Things to do after you successfully compile and run the app 9 | 10 | - Go to `ClientHomeActivity` and find `SignUpData.Builder`. Depending on 11 | what kind of `AuthType` you're using, make necessary changes to the 12 | `SignUpData` object builder and provide correct values. Run the app, 13 | and check it out! 14 | 15 | #### For configuring Notifications 16 | 17 | - Checkout the `MyFirebaseMessagingService.java` file, to see how to 18 | enable notifications in Haptik SDK 19 | 20 | #### Read documentation for further details 21 | - Visit the documentation at docs.haptik.ai 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx4608M 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | android.useAndroidX=true 19 | # Automatically convert third-party libraries to use AndroidX 20 | android.enableJetifier=true 21 | -------------------------------------------------------------------------------- /app/src/main/java/ai/haptik/android/sample/app/Utils.java: -------------------------------------------------------------------------------- 1 | package ai.haptik.android.sample.app; 2 | 3 | import ai.haptik.android.sdk.HaptikLib; 4 | import ai.haptik.android.sdk.InitData; 5 | import ai.haptik.android.sdk.picassohelper.PicassoApiFactory; 6 | import android.app.Application; 7 | 8 | public class Utils { 9 | 10 | public static InitData getHaptikInitData(Application application) { 11 | //Comment the setRunEnvironement for while releasing it to production 12 | HaptikLib.setRunEnvironment(HaptikLib.RUN_ENVIRONMENT_STAGING); 13 | return new InitData.Builder(application) 14 | .baseUrl("ADD_BASE_URL_HERE") 15 | .debugEnabled(BuildConfig.DEBUG) 16 | .notificationSound(R.raw.notification_sound) // Optional - only use if you want any non-default sound for haptik notification 17 | .imageLoadingService(PicassoApiFactory.getPicassoApi()) // This is mandatory, please refer Image Loading modules from docs.haptik.ai 18 | .build(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_offers_menu_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 19 | 20 | 28 | 29 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/java/ai/haptik/android/sample/app/MyFirebaseMessagingService.java: -------------------------------------------------------------------------------- 1 | package ai.haptik.android.sample.app; 2 | 3 | import ai.haptik.android.sdk.HaptikLib; 4 | import ai.haptik.android.sdk.notification.HaptikNotificationManager; 5 | import android.os.Handler; 6 | import com.google.firebase.messaging.FirebaseMessagingService; 7 | import com.google.firebase.messaging.RemoteMessage; 8 | import java.util.Map; 9 | 10 | public class MyFirebaseMessagingService extends FirebaseMessagingService { 11 | 12 | @Override 13 | public void onNewToken(String refreshedToken) { 14 | super.onNewToken(refreshedToken); 15 | HaptikLib.setFcmDeviceToken(this, refreshedToken); 16 | } 17 | 18 | @Override 19 | public void onMessageReceived(RemoteMessage remoteMessage) { 20 | final Map data = remoteMessage.getData(); 21 | if (HaptikNotificationManager.isHaptikNotification(data)) { 22 | if (!HaptikLib.isInitialized()) { 23 | Handler mainHandler = new Handler(getApplicationContext().getMainLooper()); 24 | mainHandler.post(new Runnable() { 25 | @Override 26 | public void run() { 27 | HaptikLib.init(Utils.getHaptikInitData(getApplication())); 28 | HaptikNotificationManager.handleNotification(getApplicationContext(), data); 29 | } 30 | }); 31 | } else { 32 | HaptikNotificationManager.handleNotification(getApplicationContext(), data); 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion "30.0.1" 6 | 7 | signingConfigs { 8 | debug { 9 | storeFile file('keystore/debug.keystore') 10 | } 11 | } 12 | 13 | defaultConfig { 14 | applicationId "ai.haptik.android.sample.app" 15 | minSdkVersion 21 16 | targetSdkVersion 30 17 | versionCode 1 18 | versionName "1.0" 19 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 20 | vectorDrawables.useSupportLibrary = true 21 | } 22 | 23 | buildTypes { 24 | debug { 25 | signingConfig signingConfigs.debug 26 | } 27 | release { 28 | signingConfig signingConfigs.debug 29 | } 30 | } 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | } 37 | 38 | dependencies { 39 | implementation fileTree(dir: "libs", include: ["*.jar"]) 40 | implementation 'androidx.appcompat:appcompat:1.2.0' 41 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 42 | implementation 'com.google.firebase:firebase-messaging:21.0.0' 43 | testImplementation 'junit:junit:4.12' 44 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 45 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 46 | implementation 'ai.haptik.android.sdk:haptiklib-core:7.0.0-70183' 47 | implementation 'ai.haptik.android.sdk:haptiklib-picasso-helper:7.0.0-70183' 48 | } 49 | 50 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_client_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 22 | 23 |