├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── answerbot_sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── answerbot_sample
│ │ ├── Global.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── chat_v2_jwt_sample
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── chat_v2
│ │ └── jwt
│ │ └── sample
│ │ ├── Global.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ └── jwt_layout.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values-night
│ └── styles.xml
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── chat_v2_message_counter_sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── chat_v2
│ │ └── sample
│ │ ├── Global.java
│ │ ├── MainActivity.java
│ │ └── UnreadMessageCounter.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ └── activity_main.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values-night
│ └── styles.xml
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── chat_v2_sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── chat_v2
│ │ └── sample
│ │ ├── Global.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values-night
│ └── styles.xml
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── demo_apps_commons
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── res
│ ├── layout
│ └── missing_credentials.xml
│ └── values
│ └── strings.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── messaging_sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── messaging_sample
│ │ ├── Global.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── scripts
└── shell
│ └── travis.sh
├── settings.gradle
├── support_custom_fields_sample
├── .gitignore
├── README
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── sample
│ │ └── customfields
│ │ ├── CustomFieldsActivity.java
│ │ └── Global.java
│ └── res
│ ├── layout
│ └── activity_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── support_override_styles
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── bfahy
│ │ └── support_override_styles
│ │ ├── Global.kt
│ │ └── MainActivity.kt
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ └── activity_main.xml
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── support_request_updates_sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── support_request_updates_sample
│ │ ├── Global.java
│ │ └── RequestUpdatesActivity.java
│ └── res
│ ├── drawable
│ └── ic_add_light.xml
│ ├── layout
│ └── activity_request_updates.xml
│ ├── menu
│ └── request_list.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── support_sample
├── .gitignore
├── build.gradle
├── lint-rules.xml
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── zenchat.png
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── sample
│ │ ├── Global.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-hdpi
│ └── ic_launcher.png
│ ├── drawable-mdpi
│ └── ic_launcher.png
│ ├── drawable-xhdpi
│ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ └── ic_launcher.png
│ ├── layout
│ └── activity_main.xml
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── support_upload_attachment_sample
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── sample
│ │ └── uploadattachment
│ │ ├── Global.java
│ │ └── UploadAttachmentActivity.java
│ └── res
│ ├── drawable-hdpi
│ └── ic_action_add.png
│ ├── drawable-mdpi
│ └── ic_action_add.png
│ ├── drawable-xhdpi
│ └── ic_action_add.png
│ ├── drawable-xxhdpi
│ └── ic_action_add.png
│ ├── layout
│ ├── activity_upload_attachment.xml
│ └── content_upload_attachment.xml
│ ├── menu
│ └── menu_upload_attachment.xml
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── values-v21
│ └── styles.xml
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── support_urbanairship_sample
├── .gitignore
├── README.md
├── build.gradle
├── lint-rules.xml
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── airshipconfig.properties
│ ├── java
│ └── com
│ │ └── zendesk
│ │ └── example
│ │ └── ua
│ │ ├── Global.java
│ │ ├── IntentReceiver.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-hdpi
│ └── ic_launcher.png
│ ├── drawable-mdpi
│ └── ic_launcher.png
│ ├── drawable-xhdpi
│ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ └── ic_launcher.png
│ ├── drawable
│ └── ic_chat_bubble.xml
│ ├── layout
│ └── activity_main.xml
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
└── talk_sample
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
└── main
├── AndroidManifest.xml
├── java
└── com
│ └── zendesk
│ └── talk
│ └── sample
│ ├── LineStatusChecker.kt
│ ├── MainActivity.kt
│ └── SampleApplication.kt
└── res
├── drawable-v24
└── ic_launcher_foreground.xml
├── drawable
├── chat_bubble.xml
├── ic_baseline_phone_24.xml
├── ic_baseline_send_24.xml
└── ic_launcher_background.xml
├── layout
└── activity_main.xml
├── menu
└── main_activity_menu.xml
├── mipmap-anydpi-v26
├── ic_launcher.xml
└── ic_launcher_round.xml
├── mipmap-hdpi
├── ic_launcher.png
└── ic_launcher_round.png
├── mipmap-mdpi
├── ic_launcher.png
└── ic_launcher_round.png
├── mipmap-xhdpi
├── ic_launcher.png
└── ic_launcher_round.png
├── mipmap-xxhdpi
├── ic_launcher.png
└── ic_launcher_round.png
├── mipmap-xxxhdpi
├── ic_launcher.png
└── ic_launcher_round.png
├── values-night
└── themes.xml
└── values
├── colors.xml
├── strings.xml
├── styles.xml
└── themes.xml
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Product
2 | Which product does this affect? Add an 'x' in all that apply.
3 | - [ ] Support
4 | - [ ] Chat
5 |
6 | ## Problem
7 | Which type of issue have you encountered? Add an 'x' in all that apply.
8 | - [ ] Demo app request
9 | - [ ] Demo app broken
10 | - [ ] Other
11 |
12 | ## Description
13 |
14 | *Which feature would you like to see demonstrated?
15 | Which demo app has broken?*
16 |
17 |
18 |
19 | ## Reviewers
20 | @zendesk/adventure-android @zendesk/two-brothers-android @zendesk/ogham @baz8080
21 |
22 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Changes
2 | *
3 |
4 | ### Reviewers
5 | * @zendesk/banshee-android
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # Android Studio Navigation editor temp files
29 | .navigation/
30 |
31 | # Android Studio captures folder
32 | captures/
33 |
34 | # Android Studio IDEA folder
35 | .idea
36 | *.iml
37 |
38 | # OSX specific
39 | .DS_Store
40 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 | dist: trusty
3 | language: android
4 | group: edge
5 | jdk:
6 | - oraclejdk8
7 | before_cache:
8 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
9 | cache:
10 | directories:
11 | - "$HOME/.gradle/caches/"
12 | - "$HOME/.gradle/wrapper/"
13 | android:
14 | components:
15 | - tools
16 | - android-27
17 | - platform-tools
18 | - build-tools-27.0.3
19 | - extra-android-m2repository
20 | licenses:
21 | - 'android-sdk-preview-license-.+'
22 | - 'android-sdk-license-.+'
23 | - '.+'
24 | branches:
25 | only:
26 | - master
27 | script:
28 | - ./scripts/shell/travis.sh
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | :warning: *Use of this software is subject to important terms and conditions as set forth in the License file* :warning:
2 |
3 | # Zendesk Sample Apps for Android
4 |
5 | ## Description
6 | This repository provides you with sample Apps to help learn how to use the [Classic Zendesk Apps](https://developer.zendesk.com/documentation/classic-web-widget-sdks/) framework and APIs.
7 |
8 | We hope you'll find those sample Apps useful and encourage you to re-use some of this code in your own Apps.
9 |
10 | To be noted that the messaging-sample here **is not** the [Zendesk SDK](https://developer.zendesk.com/documentation/zendesk-web-widget-sdks/). This repository only conver the Classic SDKs.
11 |
12 | ## Owners
13 | Please submit a ticket to [Zendesk](https://support.zendesk.com/hc/en-us/articles/4408843597850).
14 |
15 | ## Getting Started
16 | Each of the modules in this project is a stand-alone Android app, capable of being run independently through Gradle or Android Studio.
17 |
18 | ## Bugs
19 | Please submit bug reports to [Zendesk](https://support.zendesk.com/hc/en-us/articles/4408843597850) and be sure to consult our [Getting help section](https://developer.zendesk.com/documentation/classic-web-widget-sdks/getting_started/ticket-submission-guidelines-for-mobile-sdk-developers/) of our documentation.
20 |
21 |
--------------------------------------------------------------------------------
/answerbot_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/answerbot_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "com.zendesk.answerbot_sample"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.applicationId + ".answerbot_sample"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion rootProject.ext.targetSdkVersion
11 | versionCode 1
12 | versionName "1.0.0"
13 |
14 | }
15 |
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | compileOptions {
23 | sourceCompatibility JavaVersion.VERSION_17
24 | targetCompatibility JavaVersion.VERSION_17
25 | }
26 | }
27 |
28 | dependencies {
29 | implementation group: 'com.zendesk', name: 'answerbot', version: rootProject.ext.answerBotSdkVersion
30 | implementation group: 'com.zendesk', name: 'support', version: rootProject.ext.supportSdkVersion
31 | implementation group: 'com.zendesk', name: 'messaging', version: rootProject.ext.messagingSdkVersion
32 |
33 | implementation project(":demo_apps_commons")
34 | }
35 |
--------------------------------------------------------------------------------
/answerbot_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by Proguard or R8 when using Answer Bot
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
11 |
12 | -keep class zendesk.answerbot.Deflection { *; }
13 | -keep class zendesk.answerbot.AnswerBotSettings { *; }
14 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/java/com/zendesk/answerbot_sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.answerbot_sample;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.answerbot.AnswerBot;
9 | import zendesk.core.AnonymousIdentity;
10 | import zendesk.core.Zendesk;
11 | import zendesk.support.Guide;
12 | import zendesk.support.Support;
13 |
14 | public class Global extends Application {
15 |
16 | private static final String SUBDOMAIN_URL = "";
17 | private static final String APPLICATION_ID = "";
18 | private static final String OAUTH_CLIENT_ID = "";
19 |
20 | private static boolean missingCredentials = false;
21 |
22 | @Override
23 | public void onCreate() {
24 | super.onCreate();
25 |
26 | // Enable logging
27 | Logger.setLoggable(true);
28 |
29 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
30 | || StringUtils.isEmpty(APPLICATION_ID)
31 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
32 | missingCredentials = true;
33 | return;
34 | }
35 |
36 | /*
37 | Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
38 |
39 | Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
40 | */
41 | Zendesk.INSTANCE.init(this,
42 | SUBDOMAIN_URL,
43 | APPLICATION_ID,
44 | OAUTH_CLIENT_ID);
45 |
46 | /*
47 | Set an identity (authentication).
48 |
49 | Set either Anonymous or JWT identity, as below:
50 | */
51 |
52 | // a). Anonymous (All fields are optional)
53 | Zendesk.INSTANCE.setIdentity(
54 | new AnonymousIdentity.Builder()
55 | .withNameIdentifier("{optional name}")
56 | .withEmailIdentifier("{optional email}")
57 | .build()
58 | );
59 |
60 | // b). JWT (Must be initialized with your JWT identifier)
61 | // Zendesk.INSTANCE.setIdentity(new JwtIdentity("{JWT User Identifier}"));
62 | Support.INSTANCE.init(Zendesk.INSTANCE);
63 | AnswerBot.INSTANCE.init(Zendesk.INSTANCE, Guide.INSTANCE);
64 | }
65 |
66 | static boolean isMissingCredentials() {
67 | return missingCredentials;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/java/com/zendesk/answerbot_sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.answerbot_sample;
2 |
3 | import android.os.Bundle;
4 | import androidx.annotation.Nullable;
5 | import androidx.appcompat.app.AppCompatActivity;
6 |
7 | import zendesk.answerbot.AnswerBotEngine;
8 | import zendesk.messaging.MessagingActivity;
9 |
10 | public class MainActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(@Nullable Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | }
16 |
17 | @Override
18 | protected void onStart() {
19 | super.onStart();
20 | if (Global.isMissingCredentials()) {
21 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
22 | return;
23 | }
24 | MessagingActivity.builder()
25 | .withEngines(AnswerBotEngine.engine())
26 | .show(this);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/answerbot_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Answer Bot Sample App
3 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
4 |
5 |
--------------------------------------------------------------------------------
/answerbot_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | ext {
4 | applicationId = "com.zendesk"
5 | compileSdkVersion = 34
6 | minSdkVersion = 21
7 | targetSdkVersion = 34
8 |
9 | // SDK Versions
10 |
11 | supportSdkVersion = "5.1.0"
12 | chatSdkVersion = "3.3.6"
13 | answerBotSdkVersion = "3.0.9"
14 | messagingSdkVersion = "5.2.5"
15 | talkSdkVersion = "1.3.0"
16 |
17 | // Other Dependencies
18 |
19 | appCompatVersion = "1.7.0"
20 | constraintlayoutVersion = "2.1.4"
21 | lifecycleVersion = "2.5.1"
22 | belvedere2Version = "3.0.5"
23 | picassoVersion = "2.5.2"
24 | firebaseVersion = "20.2.4"
25 |
26 | }
27 |
28 | buildscript {
29 | ext.kotlin_version = '1.9.24'
30 |
31 | repositories {
32 | google()
33 | mavenCentral()
34 | }
35 | dependencies {
36 | classpath 'com.android.tools.build:gradle:8.2.1'
37 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
38 | }
39 | }
40 |
41 | allprojects {
42 | repositories {
43 | google()
44 | mavenCentral()
45 | maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
46 | }
47 | }
48 |
49 | task clean(type: Delete) {
50 | delete rootProject.buildDir
51 | }
52 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/README.md:
--------------------------------------------------------------------------------
1 | ### Chat v2 JWT Sample
2 |
3 | Please reference the HC article on JWT https://develop.zendesk.com/hc/en-us/articles/360052354433-Enabling-authenticated-users-with-the-Chat-SDK-
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | namespace "com.zendesk.chat_v2.sample"
7 | compileSdkVersion rootProject.ext.compileSdkVersion
8 |
9 | defaultConfig {
10 | applicationId rootProject.ext.applicationId + ".chat_v2_sample"
11 | minSdkVersion rootProject.ext.minSdkVersion
12 | targetSdkVersion rootProject.ext.targetSdkVersion
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_17
27 | targetCompatibility JavaVersion.VERSION_17
28 | }
29 | }
30 |
31 | dependencies {
32 | implementation group: 'com.zendesk', name: 'messaging', version: rootProject.ext.messagingSdkVersion
33 | implementation group: 'com.zendesk', name: 'chat', version: rootProject.ext.chatSdkVersion
34 |
35 | implementation project(":demo_apps_commons")
36 | }
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/java/com/zendesk/chat_v2/jwt/sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.jwt.sample;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.chat.Chat;
9 |
10 | public class Global extends Application {
11 |
12 | private static final String CHAT_ACCOUNT_KEY = "";
13 |
14 | private static boolean missingCredentials = false;
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 |
20 | // Enable logging
21 | Logger.setLoggable(true);
22 |
23 | if (StringUtils.isEmpty(CHAT_ACCOUNT_KEY)) {
24 | missingCredentials = true;
25 | return;
26 | }
27 |
28 | Chat.INSTANCE.init(this, CHAT_ACCOUNT_KEY);
29 | }
30 |
31 |
32 | static boolean isMissingCredentials() {
33 | return missingCredentials;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/java/com/zendesk/chat_v2/jwt/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.jwt.sample;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 |
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import androidx.appcompat.widget.AppCompatButton;
8 |
9 | import com.zendesk.chat_v2.sample.R;
10 |
11 | import zendesk.chat.Chat;
12 | import zendesk.chat.ChatConfiguration;
13 | import zendesk.chat.ChatEngine;
14 | import zendesk.chat.CompletionCallback;
15 | import zendesk.chat.JwtAuthenticator;
16 | import zendesk.messaging.MessagingActivity;
17 |
18 | public class MainActivity extends AppCompatActivity {
19 |
20 | AppCompatButton btnSet;
21 | AppCompatButton btnReset;
22 | AppCompatButton btnStart;
23 |
24 | JwtAuthenticator jwtAuthenticator;
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | if (Global.isMissingCredentials()) {
31 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
32 | return;
33 | }
34 | setContentView(R.layout.jwt_layout);
35 |
36 | btnSet = findViewById(R.id.btnSet);
37 | btnReset = findViewById(R.id.btnReset);
38 | btnStart = findViewById(R.id.btnStart);
39 |
40 | jwtAuthenticator = new JwtAuthenticator() {
41 | @Override
42 | public void getToken(JwtCompletion jwtCompletion) {
43 | //Fetch or generate the JWT token at this point
44 | //OnSuccess
45 | jwtCompletion.onTokenLoaded("TOKEN-HERE");
46 | //OnError
47 | jwtCompletion.onError();
48 | }
49 | };
50 |
51 | btnSet.setOnClickListener(new View.OnClickListener() {
52 | @Override
53 | public void onClick(View view) {
54 | Chat.INSTANCE.setIdentity(jwtAuthenticator);
55 | }
56 | });
57 |
58 | btnReset.setOnClickListener(new View.OnClickListener() {
59 | @Override
60 | public void onClick(View view) {
61 | Chat.INSTANCE.resetIdentity();
62 | }
63 | });
64 |
65 | btnStart.setOnClickListener(new View.OnClickListener() {
66 | @Override
67 | public void onClick(View view) {
68 | ChatConfiguration chatConfiguration = ChatConfiguration.builder().build();
69 |
70 | MessagingActivity.builder()
71 | .withEngines(ChatEngine.engine())
72 | .show(MainActivity.this, chatConfiguration);
73 | }
74 | });
75 | }
76 | }
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/layout/jwt_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
27 |
28 |
29 |
30 |
36 |
37 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_jwt_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #BB86FC
4 | #6200EE
5 | #3700B3
6 | #03DAC5
7 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Application
3 |
--------------------------------------------------------------------------------
/chat_v2_jwt_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | namespace "com.zendesk.chat_v2.sample"
7 | compileSdkVersion rootProject.ext.compileSdkVersion
8 |
9 | defaultConfig {
10 | applicationId rootProject.ext.applicationId + ".chat_v2_message_counter_sample"
11 | minSdkVersion rootProject.ext.minSdkVersion
12 | targetSdkVersion rootProject.ext.targetSdkVersion
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_17
27 | targetCompatibility JavaVersion.VERSION_17
28 | }
29 | }
30 |
31 | dependencies {
32 | implementation group: 'com.zendesk', name: 'messaging', version: rootProject.ext.messagingSdkVersion
33 | implementation group: 'com.zendesk', name: 'chat', version: rootProject.ext.chatSdkVersion
34 |
35 | implementation project(":demo_apps_commons")
36 | }
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/java/com/zendesk/chat_v2/sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.sample;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.chat.Chat;
9 |
10 | public class Global extends Application {
11 |
12 | private static final String CHAT_ACCOUNT_KEY = "";
13 |
14 | private static boolean missingCredentials = false;
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 |
20 | // Enable logging
21 | Logger.setLoggable(true);
22 |
23 | if (StringUtils.isEmpty(CHAT_ACCOUNT_KEY)) {
24 | missingCredentials = true;
25 | }
26 |
27 | Chat.INSTANCE.init(this, CHAT_ACCOUNT_KEY);
28 | }
29 |
30 |
31 | static boolean isMissingCredentials() {
32 | return missingCredentials;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/java/com/zendesk/chat_v2/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.sample;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.TextView;
6 |
7 | import androidx.appcompat.app.AppCompatActivity;
8 |
9 | import zendesk.chat.ChatConfiguration;
10 | import zendesk.chat.ChatEngine;
11 | import zendesk.messaging.MessagingActivity;
12 |
13 | public class MainActivity extends AppCompatActivity implements UnreadMessageCounter.UnreadMessageCounterListener {
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 |
19 | if (Global.isMissingCredentials()) {
20 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
21 | return;
22 | }
23 | setContentView(R.layout.activity_main);
24 | final UnreadMessageCounter unreadMessageCounter = new UnreadMessageCounter(this);
25 |
26 | findViewById(R.id.btnChat).setOnClickListener(new View.OnClickListener() {
27 | @Override
28 | public void onClick(View view) {
29 | unreadMessageCounter.stopCounter();
30 | MessagingActivity.builder()
31 | .withEngines(ChatEngine.engine())
32 | .show(MainActivity.this);
33 |
34 | }
35 | });
36 |
37 | findViewById(R.id.btnCounter).setOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View view) {
40 | unreadMessageCounter.startCounter();
41 | }
42 | });
43 | }
44 |
45 | @Override
46 | public void onUnreadCountUpdated(int unreadCount) {
47 | ((TextView) findViewById(R.id.tvMessageCounter)).setText(Integer.toString(unreadCount));
48 | }
49 | }
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/java/com/zendesk/chat_v2/sample/UnreadMessageCounter.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.sample;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import zendesk.chat.Chat;
7 | import zendesk.chat.ChatLog;
8 | import zendesk.chat.ChatState;
9 | import zendesk.chat.ObservationScope;
10 | import zendesk.chat.Observer;
11 |
12 | class UnreadMessageCounter {
13 |
14 | private final UnreadMessageCounterListener unreadMessageCounterListener;
15 |
16 | private boolean shouldCount;
17 | private String lastChatLogId;
18 | private String lastReadChatLogId;
19 |
20 | public UnreadMessageCounter(UnreadMessageCounterListener unreadMessageCounterListener) {
21 | this.unreadMessageCounterListener = unreadMessageCounterListener;
22 |
23 | Chat.INSTANCE.providers().chatProvider().observeChatState(new ObservationScope(), new Observer() {
24 | @Override
25 | public void update(ChatState chatState) {
26 | if (chatState != null && !chatState.getChatLogs().isEmpty()) {
27 | if (shouldCount && lastReadChatLogId != null) {
28 | updateCounter(chatState.getChatLogs(), lastReadChatLogId);
29 | }
30 | lastChatLogId = chatState.getChatLogs().get(
31 | chatState.getChatLogs().size() - 1
32 | ).getId();
33 | }
34 | }
35 | });
36 | }
37 |
38 |
39 | // Determines whether or not the chat websocket should be re-connected to.
40 | // A connected, open websocket will disable push notifications and receive messages as normal.
41 | public void startCounter() {
42 | shouldCount = true;
43 | lastReadChatLogId = lastChatLogId;
44 | Chat.INSTANCE.providers().connectionProvider().connect();
45 | }
46 |
47 | public void stopCounter() {
48 | lastReadChatLogId = null;
49 | shouldCount = false;
50 | unreadMessageCounterListener.onUnreadCountUpdated(0);
51 | }
52 |
53 | // Increment the counter and send an update to the listener
54 | synchronized private void updateCounter(List chatLogs, String lastReadId) {
55 | for (ChatLog chatLog : chatLogs) {
56 | if (chatLog.getId().equals(lastReadId)) {
57 | int lastReadIndex = chatLogs.indexOf(chatLog);
58 | List unreadLogs = chatLogs.subList(lastReadIndex, chatLogs.size() - 1);
59 | unreadMessageCounterListener.onUnreadCountUpdated(unreadLogs.size());
60 | break;
61 | }
62 | }
63 |
64 | }
65 |
66 | interface UnreadMessageCounterListener {
67 | void onUnreadCountUpdated(int unreadCount);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_message_counter_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #BB86FC
4 | #6200EE
5 | #3700B3
6 | #03DAC5
7 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Application
3 |
--------------------------------------------------------------------------------
/chat_v2_message_counter_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/chat_v2_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/chat_v2_sample/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | namespace "com.zendesk.chat_v2.sample"
7 | compileSdkVersion rootProject.ext.compileSdkVersion
8 |
9 | defaultConfig {
10 | applicationId rootProject.ext.applicationId + ".chat_v2_sample"
11 | minSdkVersion rootProject.ext.minSdkVersion
12 | targetSdkVersion rootProject.ext.targetSdkVersion
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_17
27 | targetCompatibility JavaVersion.VERSION_17
28 | }
29 | }
30 |
31 | dependencies {
32 | implementation group: 'com.zendesk', name: 'messaging', version: rootProject.ext.messagingSdkVersion
33 | implementation group: 'com.zendesk', name: 'chat', version: rootProject.ext.chatSdkVersion
34 |
35 | implementation project(":demo_apps_commons")
36 | }
--------------------------------------------------------------------------------
/chat_v2_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/java/com/zendesk/chat_v2/sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.sample;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.chat.Chat;
9 |
10 | public class Global extends Application {
11 |
12 | private static final String CHAT_ACCOUNT_KEY = "";
13 |
14 | private static boolean missingCredentials = false;
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 |
20 | // Enable logging
21 | Logger.setLoggable(true);
22 |
23 | if (StringUtils.isEmpty(CHAT_ACCOUNT_KEY)) {
24 | missingCredentials = true;
25 | }
26 |
27 | Chat.INSTANCE.init(this, CHAT_ACCOUNT_KEY);
28 | }
29 |
30 |
31 | static boolean isMissingCredentials() {
32 | return missingCredentials;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/java/com/zendesk/chat_v2/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.chat_v2.sample;
2 |
3 | import android.os.Bundle;
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import zendesk.chat.ChatConfiguration;
7 | import zendesk.chat.ChatEngine;
8 | import zendesk.messaging.MessagingActivity;
9 |
10 | public class MainActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | if (Global.isMissingCredentials()) {
17 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
18 | return;
19 | }
20 |
21 | ChatConfiguration chatConfiguration = ChatConfiguration.builder().build();
22 |
23 | MessagingActivity.builder()
24 | .withEngines(ChatEngine.engine())
25 | .show(this, chatConfiguration);
26 | }
27 | }
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/chat_v2_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #BB86FC
4 | #6200EE
5 | #3700B3
6 | #03DAC5
7 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Application
3 |
--------------------------------------------------------------------------------
/chat_v2_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/demo_apps_commons/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/demo_apps_commons/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | namespace "com.zendesk.demo_apps_commons"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 |
11 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
12 |
13 | }
14 |
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | compileOptions {
22 | sourceCompatibility JavaVersion.VERSION_17
23 | targetCompatibility JavaVersion.VERSION_17
24 | }
25 | }
26 |
27 | dependencies {
28 | implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24'
29 | api group: 'androidx.appcompat', name: 'appcompat', version: rootProject.ext.appCompatVersion
30 | }
31 |
--------------------------------------------------------------------------------
/demo_apps_commons/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/demo_apps_commons/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/demo_apps_commons/src/main/res/layout/missing_credentials.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
15 |
16 |
--------------------------------------------------------------------------------
/demo_apps_commons/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Demo Apps Commons
3 |
4 |
--------------------------------------------------------------------------------
/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 | android.enableJetifier=true
13 | android.useAndroidX=true
14 | org.gradle.jvmargs=-Xmx1536m
15 |
16 | # When configured, Gradle will run in incubating parallel mode.
17 | # This option should only be used with decoupled projects. More details, visit
18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
19 | # org.gradle.parallel=true
20 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
74 |
75 |
76 | @rem Execute Gradle
77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
78 |
79 | :end
80 | @rem End local scope for the variables with windows NT shell
81 | if %ERRORLEVEL% equ 0 goto mainEnd
82 |
83 | :fail
84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85 | rem the _cmd.exe /c_ return code!
86 | set EXIT_CODE=%ERRORLEVEL%
87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89 | exit /b %EXIT_CODE%
90 |
91 | :mainEnd
92 | if "%OS%"=="Windows_NT" endlocal
93 |
94 | :omega
95 |
--------------------------------------------------------------------------------
/messaging_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/messaging_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | android {
3 | namespace "com.zendesk.messaging_sample"
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 |
6 | defaultConfig {
7 | applicationId rootProject.ext.applicationId + ".messaging_sample"
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0.0"
12 |
13 | }
14 |
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | compileOptions {
22 | sourceCompatibility JavaVersion.VERSION_17
23 | targetCompatibility JavaVersion.VERSION_17
24 | }
25 | }
26 |
27 | dependencies {
28 | api group: 'com.zendesk', name: 'answerbot', version: rootProject.ext.answerBotSdkVersion
29 | implementation group: 'com.zendesk', name: 'support', version: rootProject.ext.supportSdkVersion
30 | implementation group: 'com.zendesk', name: 'chat', version: rootProject.ext.chatSdkVersion
31 |
32 | implementation project(":demo_apps_commons")
33 | }
34 |
--------------------------------------------------------------------------------
/messaging_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/messaging_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/java/com/zendesk/messaging_sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.messaging_sample;
2 |
3 |
4 | import android.app.Application;
5 |
6 | import com.zendesk.logger.Logger;
7 | import com.zendesk.util.StringUtils;
8 |
9 | import zendesk.answerbot.AnswerBot;
10 | import zendesk.chat.Chat;
11 | import zendesk.core.AnonymousIdentity;
12 | import zendesk.core.JwtIdentity;
13 | import zendesk.core.Zendesk;
14 | import zendesk.support.Guide;
15 | import zendesk.support.Support;
16 |
17 | public class Global extends Application {
18 |
19 | private static final String SUBDOMAIN_URL = "";
20 | private static final String APPLICATION_ID = "";
21 | private static final String OAUTH_CLIENT_ID = "";
22 | private final static String CHAT_ACCOUNT_KEY = "";
23 |
24 | private static boolean missingCredentials = false;
25 |
26 | @Override
27 | public void onCreate() {
28 | super.onCreate();
29 |
30 | // Enable logging
31 | Logger.setLoggable(true);
32 |
33 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
34 | || StringUtils.isEmpty(APPLICATION_ID)
35 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)
36 | || StringUtils.isEmpty(CHAT_ACCOUNT_KEY)) {
37 | missingCredentials = true;
38 | return;
39 | }
40 |
41 | /**
42 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
43 | *
44 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
45 | */
46 | Zendesk.INSTANCE.init(this,
47 | SUBDOMAIN_URL,
48 | APPLICATION_ID,
49 | OAUTH_CLIENT_ID);
50 |
51 | /**
52 | * Set an identity (authentication).
53 | *
54 | * Set either Anonymous or JWT identity, as below:
55 | */
56 |
57 | // a). Anonymous (All fields are optional)
58 | Zendesk.INSTANCE.setIdentity(
59 | new AnonymousIdentity.Builder()
60 | .withNameIdentifier("{optional name}")
61 | .withEmailIdentifier("{optional email}")
62 | .build()
63 | );
64 |
65 | // b). JWT (Must be initialized with your JWT identifier)
66 | //Zendesk.INSTANCE.setIdentity(new JwtIdentity("{JWT User Identifier}"));
67 | Support.INSTANCE.init(Zendesk.INSTANCE);
68 | AnswerBot.INSTANCE.init(Zendesk.INSTANCE, Guide.INSTANCE);
69 | Chat.INSTANCE.init(this, CHAT_ACCOUNT_KEY);
70 | }
71 |
72 | static boolean isMissingCredentials() {
73 | return missingCredentials;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/java/com/zendesk/messaging_sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.messaging_sample;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | import zendesk.answerbot.AnswerBotEngine;
7 | import zendesk.chat.ChatEngine;
8 | import zendesk.messaging.MessagingActivity;
9 | import zendesk.support.SupportEngine;
10 |
11 | public class MainActivity extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | if (Global.isMissingCredentials()) {
17 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
18 | return;
19 | }
20 |
21 | MessagingActivity.builder()
22 | .withEngines(AnswerBotEngine.engine(), SupportEngine.engine(), ChatEngine.engine())
23 | .show(this);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/messaging_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #3700B3
5 | #03DAC5
6 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | messaging_sample
3 |
--------------------------------------------------------------------------------
/messaging_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/scripts/shell/travis.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | exitOnFailedBuild() {
4 | if [ $? -ne 0 ]; then
5 | exit 1
6 | fi
7 | }
8 |
9 | boxOut(){
10 | local s="$*"
11 | tput setaf 3
12 | echo -e " =${s//?/=}=\n| $(tput setaf 4)$s$(tput setaf 3) |\n =${s//?/=}=\n"
13 | tput sgr 0
14 | }
15 |
16 | acceptLicenses() {
17 | mkdir -p ${ANDROID_HOME}licenses
18 | echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > ${ANDROID_HOME}licenses/android-sdk-license
19 | }
20 |
21 | buildAll() {
22 | ./gradlew assembleRelease
23 | }
24 |
25 | # Build types
26 | pullRequestBuild() {
27 | boxOut "Build All Sample Apps"
28 | acceptLicenses
29 | buildAll
30 | }
31 |
32 | # do the thing
33 | pullRequestBuild
34 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':support_custom_fields_sample'
2 | include ':chat_v2_providers_sample'
3 | include ':support_upload_attachment_sample'
4 | include ':support_sample'
5 | include ':support_request_updates_sample'
6 | include ':support_urbanairship_sample'
7 | include ':answerbot_sample'
8 | include ':support_override_styles'
9 | include ':demo_apps_commons'
10 | include ':messaging_sample'
11 | include ':chat_v2_sample'
12 | include ':chat_v2_message_counter_sample'
13 | include ':chat_v2_jwt_sample'
14 | include ':talk_sample'
--------------------------------------------------------------------------------
/support_custom_fields_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/README:
--------------------------------------------------------------------------------
1 | ## Sending custom fields in a request
2 |
3 | This sample shows you how to send custom field values using the SDK.
4 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "com.zendesk.sample.customfields"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.applicationId + ".customfields"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion rootProject.ext.targetSdkVersion
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | compileOptions {
21 | sourceCompatibility JavaVersion.VERSION_17
22 | targetCompatibility JavaVersion.VERSION_17
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation group: 'com.zendesk', name: 'support-providers', version: rootProject.ext.supportSdkVersion
28 | implementation group: 'androidx.appcompat', name: 'appcompat', version: rootProject.ext.appCompatVersion
29 |
30 | implementation project(":demo_apps_commons")
31 | }
32 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by R8 when using the Support SDK
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/java/com/zendesk/sample/customfields/CustomFieldsActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.sample.customfields;
2 |
3 | import android.app.ProgressDialog;
4 | import android.os.Bundle;
5 | import androidx.appcompat.app.AppCompatActivity;
6 | import android.util.Log;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.EditText;
10 | import android.widget.Toast;
11 |
12 | import com.zendesk.service.ErrorResponse;
13 | import com.zendesk.service.ZendeskCallback;
14 |
15 | import java.util.ArrayList;
16 | import java.util.List;
17 |
18 | import zendesk.support.CreateRequest;
19 | import zendesk.support.CustomField;
20 | import zendesk.support.Request;
21 | import zendesk.support.RequestProvider;
22 | import zendesk.support.Support;
23 |
24 | public class CustomFieldsActivity extends AppCompatActivity {
25 |
26 | private static final String TAG = "CustomFieldsActivity";
27 |
28 | // EditText Views for text input for custom fields
29 | private EditText customInput1;
30 | private EditText customInput2;
31 | private EditText customInput3;
32 | private EditText customInput4;
33 | private Button submitButton;
34 |
35 | private ProgressDialog progressDialog;
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | if (Global.isMissingCredentials()) {
41 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
42 | return;
43 | }
44 | setContentView(R.layout.activity_main);
45 |
46 | // Uninteresting method of findViewById calls
47 | captureViews();
48 |
49 | submitButton.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | // Show friendly ProgressDialog with indeterminate progress spinner, non-cancelable.
53 | progressDialog = ProgressDialog.show(CustomFieldsActivity.this, "Sending Request", "Aligning 1s and 0s...", true, false);
54 |
55 | // Get an instance of the RequestProvider from the ZendeskConfig
56 | RequestProvider provider = Support.INSTANCE.provider().requestProvider();
57 |
58 | // Build your CreateRequest object, which includes the custom field data
59 | CreateRequest request = buildCreateRequest();
60 |
61 | // Optionally, create a ZendeskCallback. This can be null.
62 | ZendeskCallback callback = buildCallback();
63 |
64 | // Call the provider method
65 | provider.createRequest(request, callback);
66 | }
67 | });
68 | }
69 |
70 | private CreateRequest buildCreateRequest() {
71 | // Create an instance of CreateRequest
72 | CreateRequest request = new CreateRequest();
73 |
74 | // Set any details on it you want
75 | // request.setTicketFormId("formID");
76 | request.setSubject("Test Custom Fields Ticket");
77 | request.setDescription("We should see custom fields on this ticket!");
78 |
79 | // Build CustomField objects as desired, using the Custom Field IDs from your Zendesk dashboard.
80 | request.setCustomFields(buildCustomFieldsList());
81 | return request;
82 | }
83 |
84 | private List buildCustomFieldsList() {
85 | List list = new ArrayList<>();
86 |
87 | // Make sure to use the Custom Field IDs from your Zendesk dashboard!
88 | list.add(new CustomField(1L, customInput1.getText().toString()));
89 | list.add(new CustomField(2L, customInput2.getText().toString()));
90 | list.add(new CustomField(3L, customInput3.getText().toString()));
91 | list.add(new CustomField(4L, customInput4.getText().toString()));
92 |
93 | return list;
94 | }
95 |
96 | private ZendeskCallback buildCallback() {
97 | // Build the optional callback to handle success/error
98 | return new ZendeskCallback() {
99 | @Override
100 | public void onSuccess(Request createRequest) {
101 | progressDialog.dismiss();
102 | Log.d(TAG, "onSuccess: Ticket created!");
103 | Toast.makeText(getApplicationContext(), "Success! Ticket created!", Toast.LENGTH_SHORT).show();
104 | }
105 |
106 | @Override
107 | public void onError(ErrorResponse errorResponse) {
108 | progressDialog.dismiss();
109 | Log.d(TAG, "onError: " + errorResponse.getReason());
110 | Toast.makeText(getApplicationContext(), "Error! " + errorResponse.getReason(), Toast.LENGTH_SHORT).show();
111 | }
112 | };
113 | }
114 |
115 | private void captureViews() {
116 | customInput1 = findViewById(R.id.customInput1);
117 | customInput2 = findViewById(R.id.customInput2);
118 | customInput3 = findViewById(R.id.customInput3);
119 | customInput4 = findViewById(R.id.customInput4);
120 | submitButton = findViewById(R.id.btnSubmit);
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/java/com/zendesk/sample/customfields/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.sample.customfields;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.core.AnonymousIdentity;
9 | import zendesk.core.JwtIdentity;
10 | import zendesk.core.Zendesk;
11 | import zendesk.support.Support;
12 |
13 | public class Global extends Application {
14 |
15 | private static final String SUBDOMAIN_URL = "";
16 | private static final String APPLICATION_ID = "";
17 | private static final String OAUTH_CLIENT_ID = "";
18 |
19 | private static boolean missingCredentials = false;
20 |
21 | @Override
22 | public void onCreate() {
23 | super.onCreate();
24 |
25 | // Enable logging
26 | Logger.setLoggable(true);
27 |
28 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
29 | || StringUtils.isEmpty(APPLICATION_ID)
30 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
31 | missingCredentials = true;
32 | return;
33 | }
34 |
35 | /**
36 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
37 | *
38 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
39 | */
40 | Zendesk.INSTANCE.init(this,
41 | SUBDOMAIN_URL,
42 | APPLICATION_ID,
43 | OAUTH_CLIENT_ID);
44 |
45 | /**
46 | * Set an identity (authentication).
47 | *
48 | * Set either Anonymous or JWT identity, as below:
49 | */
50 |
51 | // a). Anonymous (All fields are optional)
52 | Zendesk.INSTANCE.setIdentity(
53 | new AnonymousIdentity.Builder()
54 | .withNameIdentifier("{optional name}")
55 | .withEmailIdentifier("{optional email}")
56 | .build()
57 | );
58 |
59 | // b). JWT (Must be initialized with your JWT identifier)
60 | //Zendesk.INSTANCE.setIdentity(new JwtIdentity("{JWT User Identifier}"));
61 | Support.INSTANCE.init(Zendesk.INSTANCE);
62 | }
63 |
64 | static boolean isMissingCredentials() {
65 | return missingCredentials;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
25 |
26 |
33 |
34 |
41 |
42 |
49 |
50 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_custom_fields_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Zendesk Custom Fields Sample
3 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
4 |
5 |
--------------------------------------------------------------------------------
/support_custom_fields_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/support_override_styles/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/support_override_styles/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 |
4 | android {
5 | namespace "bfahy.support_override_styles"
6 | compileSdkVersion rootProject.ext.compileSdkVersion
7 |
8 | defaultConfig {
9 | applicationId "bfahy.support_override_styles"
10 | minSdkVersion rootProject.ext.minSdkVersion
11 | targetSdkVersion rootProject.ext.targetSdkVersion
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
16 |
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | api group: 'com.zendesk', name: 'support', version: rootProject.ext.supportSdkVersion
30 |
31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
32 |
33 | implementation project(":demo_apps_commons")
34 | }
35 |
--------------------------------------------------------------------------------
/support_override_styles/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by R8 when using the Support SDK
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
--------------------------------------------------------------------------------
/support_override_styles/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
27 |
30 |
31 |
34 |
35 |
38 |
39 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/java/bfahy/support_override_styles/Global.kt:
--------------------------------------------------------------------------------
1 | package bfahy.support_override_styles
2 |
3 | import android.app.Application
4 | import com.zendesk.logger.Logger
5 | import com.zendesk.util.StringUtils
6 | import zendesk.core.AnonymousIdentity
7 | import zendesk.core.JwtIdentity
8 | import zendesk.core.Zendesk
9 | import zendesk.support.Support
10 |
11 | class Global : Application() {
12 |
13 | private val SUBDOMAIN_URL = ""
14 | private val APPLICATION_ID = ""
15 | private val OAUTH_CLIENT_ID = ""
16 |
17 | companion object {
18 | private var missingCredentials = false
19 | fun isMissingCredentials(): Boolean {
20 | return missingCredentials
21 | }
22 | }
23 |
24 |
25 | override fun onCreate() {
26 | super.onCreate()
27 |
28 | // Enable logging
29 | Logger.setLoggable(true)
30 |
31 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
32 | || StringUtils.isEmpty(APPLICATION_ID)
33 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
34 | missingCredentials = true
35 | return
36 | }
37 |
38 | /**
39 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
40 | *
41 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
42 | */
43 | Zendesk.INSTANCE.init(this,
44 | SUBDOMAIN_URL,
45 | APPLICATION_ID,
46 | OAUTH_CLIENT_ID)
47 |
48 | /**
49 | * Set an identity (authentication).
50 | *
51 | * Set either Anonymous or JWT identity, as below:
52 | */
53 |
54 | // a). Anonymous (All fields are optional)
55 | Zendesk.INSTANCE.setIdentity(
56 | AnonymousIdentity.Builder()
57 | .withNameIdentifier("{optional name}")
58 | .withEmailIdentifier("{optional email}")
59 | .build()
60 | )
61 |
62 | // b). JWT (Must be initialized with your JWT identifier)
63 | //Zendesk.INSTANCE.setIdentity(JwtIdentity("{JWT User Identifier}"))
64 | Support.INSTANCE.init(Zendesk.INSTANCE)
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/java/bfahy/support_override_styles/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package bfahy.support_override_styles
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 | import kotlinx.android.synthetic.main.activity_main.*
6 | import zendesk.support.guide.HelpCenterActivity
7 | import zendesk.support.requestlist.RequestListActivity
8 |
9 | class MainActivity : AppCompatActivity() {
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | if (Global.isMissingCredentials()) {
14 | setContentView(R.layout.missing_credentials)
15 | return
16 | }
17 | setContentView(R.layout.activity_main)
18 |
19 | helpCenterBtn.setOnClickListener {
20 | HelpCenterActivity
21 | .builder()
22 | .show(this@MainActivity)
23 | }
24 |
25 | requestListBtn.setOnClickListener {
26 | RequestListActivity
27 | .builder()
28 | .show(this@MainActivity)
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
28 |
29 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_override_styles/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_override_styles/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | support_override_styles
3 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
4 |
5 |
--------------------------------------------------------------------------------
/support_override_styles/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/support_request_updates_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/support_request_updates_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "com.zendesk.support_request_updates_sample"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.applicationId + ".support"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion rootProject.ext.targetSdkVersion
11 | versionCode 44
12 | versionName "1.0.0.1"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | compileOptions {
21 | sourceCompatibility JavaVersion.VERSION_17
22 | targetCompatibility JavaVersion.VERSION_17
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation group: 'com.zendesk', name: 'support', version: rootProject.ext.supportSdkVersion
28 |
29 | implementation project(":demo_apps_commons")
30 | }
31 |
--------------------------------------------------------------------------------
/support_request_updates_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by R8 when using the Support SDK
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/java/com/zendesk/support_request_updates_sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.support_request_updates_sample;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.core.AnonymousIdentity;
9 | import zendesk.core.Zendesk;
10 | import zendesk.support.Support;
11 |
12 | public class Global extends Application {
13 |
14 | private static final String SUBDOMAIN_URL = "";
15 | private static final String APPLICATION_ID = "";
16 | private static final String OAUTH_CLIENT_ID = "";
17 |
18 | private static boolean missingCredentials = false;
19 |
20 | @Override
21 | public void onCreate() {
22 | super.onCreate();
23 |
24 | // Enable logging
25 | Logger.setLoggable(true);
26 |
27 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
28 | || StringUtils.isEmpty(APPLICATION_ID)
29 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
30 | missingCredentials = true;
31 | return;
32 | }
33 |
34 | /**
35 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
36 | *
37 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
38 | */
39 | Zendesk.INSTANCE.init(this,
40 | SUBDOMAIN_URL,
41 | APPLICATION_ID,
42 | OAUTH_CLIENT_ID);
43 |
44 | /**
45 | * Set an identity (authentication).
46 | *
47 | * Set either Anonymous or JWT identity, as below:
48 | */
49 |
50 | // a). Anonymous (All fields are optional)
51 | Zendesk.INSTANCE.setIdentity(
52 | new AnonymousIdentity.Builder()
53 | .withNameIdentifier("{optional name}")
54 | .withEmailIdentifier("{optional email}")
55 | .build()
56 | );
57 |
58 | // b). JWT (Must be initialized with your JWT identifier)
59 | // Zendesk.INSTANCE.setIdentity(new JwtIdentity("{JWT User Identifier}"));
60 |
61 | Support.INSTANCE.init(Zendesk.INSTANCE);
62 | }
63 |
64 | static boolean isMissingCredentials() {
65 | return missingCredentials;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/java/com/zendesk/support_request_updates_sample/RequestUpdatesActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.support_request_updates_sample;
2 |
3 | import android.os.Bundle;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import android.view.View;
6 | import android.widget.Button;
7 |
8 | import com.zendesk.logger.Logger;
9 | import com.zendesk.service.ErrorResponse;
10 | import com.zendesk.service.ZendeskCallback;
11 |
12 | import zendesk.support.RequestUpdates;
13 | import zendesk.support.Support;
14 | import zendesk.support.requestlist.RequestListActivity;
15 |
16 | public class RequestUpdatesActivity extends AppCompatActivity {
17 |
18 | private final static String LOG_TAG = "RequestUpdatesActivity";
19 |
20 | private final static String TICKET_LIST_BUTTON_TEXT = "Ticket List";
21 |
22 | private Button ticketListButton;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | if (Global.isMissingCredentials()) {
28 | setContentView(com.zendesk.demo_apps_commons.R.layout.missing_credentials);
29 | return;
30 | }
31 | setContentView(R.layout.activity_request_updates);
32 |
33 | ticketListButton = findViewById(R.id.ticket_list_button);
34 | ticketListButton.setOnClickListener(new View.OnClickListener() {
35 | @Override
36 | public void onClick(View v) {
37 | RequestListActivity.builder().show(RequestUpdatesActivity.this);
38 | }
39 | });
40 |
41 | findViewById(R.id.request_updates_button).setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View v) {
44 | Support.INSTANCE.provider().requestProvider().getUpdatesForDevice(new ZendeskCallback() {
45 | @Override
46 | public void onSuccess(RequestUpdates requestUpdates) {
47 | if (requestUpdates != null && requestUpdates.hasUpdatedRequests()) {
48 | ticketListButton.setText(TICKET_LIST_BUTTON_TEXT + " (" + requestUpdates.getRequestUpdates().size() + " new)");
49 | } else {
50 | ticketListButton.setText(TICKET_LIST_BUTTON_TEXT);
51 | }
52 | }
53 |
54 | @Override
55 | public void onError(ErrorResponse errorResponse) {
56 | Logger.d(LOG_TAG, "Error getting updates for device " + errorResponse);
57 | }
58 | });
59 | }
60 | });
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/drawable/ic_add_light.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/layout/activity_request_updates.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/menu/request_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_request_updates_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Request Updates
3 | Ticket List
4 | Create Ticket
5 | Request Updates
6 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
7 |
8 |
--------------------------------------------------------------------------------
/support_request_updates_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/support_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/support_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "com.zendesk.sample"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.applicationId + ".support"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion rootProject.ext.targetSdkVersion
11 | versionCode 44
12 | versionName "1.0.0.1"
13 | }
14 |
15 | lintOptions {
16 | abortOnError true
17 | lintConfig file("lint-rules.xml")
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_17
28 | targetCompatibility JavaVersion.VERSION_17
29 | }
30 | }
31 |
32 | dependencies {
33 | api group: 'com.zendesk', name: 'support', version: rootProject.ext.supportSdkVersion
34 |
35 | implementation project(":demo_apps_commons")
36 | }
37 |
--------------------------------------------------------------------------------
/support_sample/lint-rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/support_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by R8 when using the Support SDK
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
--------------------------------------------------------------------------------
/support_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/support_sample/src/main/assets/zenchat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_sample/src/main/assets/zenchat.png
--------------------------------------------------------------------------------
/support_sample/src/main/java/com/zendesk/sample/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.sample;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.core.AnonymousIdentity;
9 | import zendesk.core.JwtIdentity;
10 | import zendesk.core.Zendesk;
11 | import zendesk.support.Support;
12 |
13 | public class Global extends Application {
14 |
15 | private static final String SUBDOMAIN_URL = "";
16 | private static final String APPLICATION_ID = "";
17 | private static final String OAUTH_CLIENT_ID = "";
18 |
19 | private static boolean missingCredentials = false;
20 |
21 | @Override
22 | public void onCreate() {
23 | super.onCreate();
24 |
25 | // Enable logging
26 | Logger.setLoggable(true);
27 |
28 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
29 | || StringUtils.isEmpty(APPLICATION_ID)
30 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
31 | missingCredentials = true;
32 | return;
33 | }
34 |
35 | /**
36 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
37 | *
38 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
39 | */
40 | Zendesk.INSTANCE.init(this,
41 | SUBDOMAIN_URL,
42 | APPLICATION_ID,
43 | OAUTH_CLIENT_ID);
44 |
45 | /**
46 | * Set an identity (authentication).
47 | *
48 | * Set either Anonymous or JWT identity, as below:
49 | */
50 |
51 | // a). Anonymous (All fields are optional)
52 | Zendesk.INSTANCE.setIdentity(
53 | new AnonymousIdentity.Builder()
54 | .withNameIdentifier("{optional name}")
55 | .withEmailIdentifier("{optional email}")
56 | .build()
57 | );
58 |
59 | // b). JWT (Must be initialized with your JWT identifier)
60 | Zendesk.INSTANCE.setIdentity(new JwtIdentity("{JWT User Identifier}"));
61 |
62 | Support.INSTANCE.init(Zendesk.INSTANCE);
63 | }
64 |
65 | static boolean isMissingCredentials() {
66 | return missingCredentials;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/support_sample/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_sample/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_sample/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_sample/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_sample/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_sample/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_sample/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_sample/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
19 |
20 |
25 |
26 |
32 |
33 |
38 |
39 |
45 |
46 |
50 |
51 |
57 |
58 |
64 |
65 |
71 |
72 |
73 |
74 |
80 |
81 |
85 |
86 |
92 |
93 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/support_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2196F3
4 | #1976D2
5 | #FFC107
6 |
--------------------------------------------------------------------------------
/support_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SDK Sample
5 | Contact Zendesk
6 | Ticket List
7 | Support
8 | label1,label2 or [category_id] (optional)
9 |
10 | Push device token
11 | Register Push
12 | Register Push UA
13 | Unregister Push
14 |
15 | User tags
16 | Add tags
17 | Remove tags
18 |
19 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
20 |
21 |
--------------------------------------------------------------------------------
/support_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/README.md:
--------------------------------------------------------------------------------
1 | ## Upload Attachments Sample App
2 |
3 | This sample shows how to use the `UploadProvider` and the `RequestProvider` from the Support SDK for Android
4 | `sdk-providers` module to implement your own UI for adding attachments to a request.
5 |
6 | For the sake of simplicity of illustration, the UI is very basic, but it functions as a complete,
7 | functioning example of how the providers can be used.
8 |
9 | Note that there is no reason the files uploaded need to be chosen by the user - they could be added
10 | programmatically without user intervention. This could be useful for adding log files, or any other
11 | data the host app has access to.
12 |
13 | ### Two-step process
14 |
15 | Adding files to a request is a two-step process. The files must be uploaded using the `UploadProvider`,
16 | and then the IDs for the files returned by the `UploadProvider` must be used to associate them with
17 | the request, via the `RequestProvider`. See the `UploadAttachmentActivity` for code that illustrates this.
18 |
19 | ### Picking files - Belvedere
20 |
21 | The sample uses the open-source [Belvedere library](https://github.com/zendesk/belvedere) for
22 | getting files from the camera or device storage without requiring any permissions.
--------------------------------------------------------------------------------
/support_upload_attachment_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "com.zendesk.sample.uploadattachment"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.applicationId + ".uploadattachment"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion rootProject.ext.targetSdkVersion
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | compileOptions {
21 | sourceCompatibility JavaVersion.VERSION_17
22 | targetCompatibility JavaVersion.VERSION_17
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation group: 'com.zendesk', name: 'support-providers', version: rootProject.ext.supportSdkVersion
28 | implementation group: 'com.zendesk', name: 'belvedere', version: "1.1.1.1"
29 |
30 | implementation group: 'androidx.appcompat', name: 'appcompat', version: rootProject.ext.appCompatVersion
31 | implementation group: 'com.google.android.material', name: 'material', version: rootProject.ext.appCompatVersion
32 |
33 | implementation project(":demo_apps_commons")
34 | }
35 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by R8 when using the Support SDK
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/java/com/zendesk/sample/uploadattachment/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.sample.uploadattachment;
2 |
3 | import android.app.Application;
4 |
5 | import com.zendesk.logger.Logger;
6 | import com.zendesk.util.StringUtils;
7 |
8 | import zendesk.core.AnonymousIdentity;
9 | import zendesk.core.JwtIdentity;
10 | import zendesk.core.Zendesk;
11 | import zendesk.support.Support;
12 |
13 | public class Global extends Application {
14 |
15 |
16 | private static final String SUBDOMAIN_URL = "";
17 | private static final String APPLICATION_ID = "";
18 | private static final String OAUTH_CLIENT_ID = "";
19 |
20 | private static boolean missingCredentials = false;
21 |
22 | @Override
23 | public void onCreate() {
24 | super.onCreate();
25 |
26 | // Enable logging
27 | Logger.setLoggable(true);
28 |
29 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
30 | || StringUtils.isEmpty(APPLICATION_ID)
31 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
32 | missingCredentials = true;
33 | return;
34 | }
35 |
36 | /**
37 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
38 | *
39 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
40 | */
41 | Zendesk.INSTANCE.init(this,
42 | SUBDOMAIN_URL,
43 | APPLICATION_ID,
44 | OAUTH_CLIENT_ID);
45 |
46 | /**
47 | * Set an identity (authentication).
48 | *
49 | * Set either Anonymous or JWT identity, as below:
50 | */
51 |
52 | // a). Anonymous (All fields are optional)
53 | Zendesk.INSTANCE.setIdentity(
54 | new AnonymousIdentity.Builder()
55 | .withNameIdentifier("{optional name}")
56 | .withEmailIdentifier("{optional email}")
57 | .build()
58 | );
59 |
60 | // b). JWT (Must be initialized with your JWT identifier)
61 | Zendesk.INSTANCE.setIdentity(new JwtIdentity("{JWT User Identifier}"));
62 |
63 | Support.INSTANCE.init(Zendesk.INSTANCE);
64 | }
65 |
66 | static boolean isMissingCredentials() {
67 | return missingCredentials;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/drawable-hdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_upload_attachment_sample/src/main/res/drawable-hdpi/ic_action_add.png
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/drawable-mdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_upload_attachment_sample/src/main/res/drawable-mdpi/ic_action_add.png
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/drawable-xhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_upload_attachment_sample/src/main/res/drawable-xhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/drawable-xxhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_upload_attachment_sample/src/main/res/drawable-xxhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/layout/activity_upload_attachment.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/layout/content_upload_attachment.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
24 |
25 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/menu/menu_upload_attachment.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_upload_attachment_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Upload Attachment Sample
3 | Settings
4 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
5 |
6 |
--------------------------------------------------------------------------------
/support_upload_attachment_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/README.md:
--------------------------------------------------------------------------------
1 | :warning: *Use of this software is subject to important terms and conditions as set forth in the License file* :warning:
2 |
3 | # Zendesk Mobile SDK Android Demo app
4 | This app demonstrates how to integrate the Urban Airship and the Zendesk mobile SDK.
5 |
6 | ### Initial set up:
7 | 1. Clone the repository: `git clone https://github.com/zendesk/android_sdk_demo_app.git`
8 | 2. Import project into your Android Studio: `File` -> `New` -> `Import Project...`
9 | 3. In the support_urbanairship_sample module, add your Zendesk login credentials
10 | 1. Update `res/values/zd.xml` with your Zendesk Url, Application Id and oAuth client Id
11 | 4. In the support_urbanairship_sample module, add your Urban Airship details:
12 | 1. Update `assets/airshipconfig.properties`
13 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "com.zendesk.example.ua"
5 | compileSdkVersion rootProject.ext.compileSdkVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.applicationId + ".example.ua"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion 34
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 |
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | compileOptions {
22 | sourceCompatibility JavaVersion.VERSION_17
23 | targetCompatibility JavaVersion.VERSION_17
24 | }
25 |
26 | lintOptions {
27 | abortOnError true
28 | lintConfig file("lint-rules.xml")
29 | }
30 | }
31 |
32 | dependencies {
33 | implementation group: 'com.zendesk', name: 'support', version: rootProject.ext.supportSdkVersion
34 | implementation group: 'com.urbanairship.android', name: 'urbanairship-sdk', version: '9.3.1'
35 | implementation group: 'com.google.android.gms', name: 'play-services-gcm', version: '16.1.0'
36 |
37 | implementation project(":demo_apps_commons")
38 | }
--------------------------------------------------------------------------------
/support_urbanairship_sample/lint-rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep classes which may be lost by R8 when using the Support SDK
2 |
3 | -keep class zendesk.core.AuthenticationRequestWrapper { *; }
4 | -keep class zendesk.core.PushRegistrationRequestWrapper { *; }
5 | -keep class zendesk.core.PushRegistrationRequest { *; }
6 | -keep class zendesk.core.PushRegistrationResponse { *; }
7 | -keep class zendesk.core.ApiAnonymousIdentity { *; }
8 |
9 | -keep class zendesk.support.CreateRequestWrapper { *; }
10 | -keep class zendesk.support.Comment { *; }
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
41 |
42 |
43 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/assets/airshipconfig.properties:
--------------------------------------------------------------------------------
1 | developmentAppKey =
2 | developmentAppSecret =
3 | productionAppKey =
4 | productionAppSecret =
5 |
6 | gcmSender =
7 | inProduction = false
8 | analyticsEnabled = false
9 |
10 | # LogLevel is "VERBOSE", "DEBUG", "INFO", "WARN", "ERROR" or "ASSERT"
11 | developmentLogLevel = DEBUG
12 | productionLogLevel = ERROR
13 | minSdkVersion = 4
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/java/com/zendesk/example/ua/Global.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.example.ua;
2 |
3 | import android.app.Application;
4 |
5 | import com.urbanairship.UAirship;
6 | import com.urbanairship.push.notifications.DefaultNotificationFactory;
7 | import com.zendesk.logger.Logger;
8 | import com.zendesk.util.StringUtils;
9 |
10 | import zendesk.core.AnonymousIdentity;
11 | import zendesk.core.Zendesk;
12 | import zendesk.support.Support;
13 |
14 |
15 | public class Global extends Application {
16 |
17 | static final String SUBDOMAIN_URL = "";
18 | static final String APPLICATION_ID = "";
19 | static final String OAUTH_CLIENT_ID = "";
20 |
21 | private static boolean missingCredentials = false;
22 |
23 | @Override
24 | public void onCreate() {
25 | super.onCreate();
26 | Logger.setLoggable(true);
27 |
28 | if (StringUtils.isEmpty(SUBDOMAIN_URL)
29 | || StringUtils.isEmpty(APPLICATION_ID)
30 | || StringUtils.isEmpty(OAUTH_CLIENT_ID)) {
31 | missingCredentials = true;
32 | return;
33 | }
34 |
35 | Zendesk.INSTANCE.init(this,
36 | SUBDOMAIN_URL,
37 | APPLICATION_ID,
38 | OAUTH_CLIENT_ID);
39 |
40 | Zendesk.INSTANCE.setIdentity(
41 | new AnonymousIdentity.Builder()
42 | .withNameIdentifier("{Optional name}")
43 | .withEmailIdentifier("{Optional email}")
44 | .build()
45 | );
46 |
47 | Support.INSTANCE.init(Zendesk.INSTANCE);
48 | initUrbanAirship();
49 | }
50 |
51 | private void initUrbanAirship() {
52 |
53 | // Initialize Urban Airship
54 | UAirship.takeOff(this);
55 |
56 | // Enable push notification
57 | UAirship.shared().getPushManager().setUserNotificationsEnabled(true);
58 |
59 | // 'ic_chat_bubble_outline_black_24dp' should be displayed as notification icon
60 | final DefaultNotificationFactory defaultNotificationFactory = new DefaultNotificationFactory(getApplicationContext());
61 | defaultNotificationFactory.setSmallIconId(R.drawable.ic_chat_bubble);
62 | UAirship.shared().getPushManager().setNotificationFactory(defaultNotificationFactory);
63 | }
64 |
65 | static boolean isMissingCredentials() {
66 | return missingCredentials;
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/java/com/zendesk/example/ua/IntentReceiver.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.example.ua;
2 |
3 | import android.app.NotificationManager;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import androidx.annotation.NonNull;
7 | import androidx.annotation.Nullable;
8 |
9 | import com.urbanairship.AirshipReceiver;
10 | import com.urbanairship.push.PushMessage;
11 | import com.zendesk.logger.Logger;
12 | import com.zendesk.util.StringUtils;
13 |
14 | import java.util.Locale;
15 |
16 | import zendesk.core.Zendesk;
17 | import zendesk.support.Support;
18 | import zendesk.support.request.RequestActivity;
19 |
20 | public class IntentReceiver extends AirshipReceiver {
21 |
22 | private final static String LOG_TAG = IntentReceiver.class.getSimpleName();
23 |
24 | @Override
25 | protected void onNotificationPosted(@NonNull Context context, @NonNull NotificationInfo notificationInfo) {
26 |
27 | PushMessage message = notificationInfo.getMessage();
28 |
29 | final String tid = message.getPushBundle().getString("tid");
30 |
31 | // Check if ticket id is valid
32 | if (!StringUtils.hasLength(tid)) {
33 | Logger.e(LOG_TAG, String.format(Locale.US, "No valid ticket id found: '%s'", tid));
34 | return;
35 | }
36 |
37 | // Try to refresh the comment stream if visible
38 | final boolean refreshed = Support.INSTANCE.refreshRequest(tid, context);
39 |
40 | // If stream was successfully refreshed, we can cancel the notification
41 | if (refreshed) {
42 | final NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
43 | nm.cancel(notificationInfo.getNotificationId());
44 | }
45 |
46 | }
47 |
48 | @Override
49 | protected boolean onNotificationOpened(@NonNull Context context, @NonNull NotificationInfo notificationInfo) {
50 | // Return false here to allow Urban Airship to auto launch the launcher activity
51 |
52 | // Extract ticket id
53 | final String tid = notificationInfo.getMessage().getPushBundle().getString("tid");
54 |
55 | // Check if ticket id is valid
56 | if (!StringUtils.hasLength(tid)) {
57 | Logger.e(LOG_TAG, String.format(Locale.US, "No valid ticket id found: '%s'", tid));
58 | return false;
59 | }
60 |
61 | Logger.d(LOG_TAG, String.format(Locale.US, "Ticket Id found: %s", tid));
62 |
63 | // Create an Intent for showing RequestActivity
64 | final Intent zendeskDeepLinkIntent = getZendeskDeepLinkIntent(context.getApplicationContext(), tid);
65 |
66 | // Check if Intent is valid
67 | if (zendeskDeepLinkIntent == null) {
68 | Logger.e(LOG_TAG, "Error zendeskDeepLinkIntent is 'null'");
69 | return false;
70 | }
71 |
72 | // Show RequestActivity
73 | context.sendBroadcast(zendeskDeepLinkIntent);
74 |
75 | return true;
76 | }
77 |
78 | @Nullable
79 | private Intent getZendeskDeepLinkIntent(Context context, String ticketId) {
80 |
81 | // Make sure that Zendesk is initialized
82 | if (!Zendesk.INSTANCE.isInitialized()) {
83 | Zendesk.INSTANCE.init(
84 | context,
85 | Global.SUBDOMAIN_URL,
86 | Global.APPLICATION_ID,
87 | Global.OAUTH_CLIENT_ID
88 | );
89 | Support.INSTANCE.init(Zendesk.INSTANCE);
90 | }
91 |
92 | // Initialize a back stack
93 | final Intent mainActivity = new Intent(context, MainActivity.class);
94 |
95 | return RequestActivity.builder().withRequestId(ticketId).deepLinkIntent(context, mainActivity);
96 | }
97 | }
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/java/com/zendesk/example/ua/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.zendesk.example.ua;
2 |
3 | import android.os.Bundle;
4 | import androidx.fragment.app.FragmentActivity;
5 | import android.view.View;
6 | import android.widget.EditText;
7 | import android.widget.Toast;
8 |
9 | import com.urbanairship.UAirship;
10 | import com.urbanairship.google.PlayServicesUtils;
11 | import com.zendesk.logger.Logger;
12 | import com.zendesk.service.ErrorResponse;
13 | import com.zendesk.service.ZendeskCallback;
14 |
15 | import java.util.Locale;
16 |
17 | import zendesk.core.Zendesk;
18 | import zendesk.support.guide.HelpCenterActivity;
19 | import zendesk.support.request.RequestActivity;
20 | import zendesk.support.requestlist.RequestListActivity;
21 |
22 | /**
23 | * This activity is a springboard that you can use to launch various parts of the Zendesk SDK.
24 | */
25 | public class MainActivity extends FragmentActivity {
26 |
27 | private static final String LOG_TAG = "MainActivity";
28 |
29 | @Override
30 | public void onStart() {
31 | super.onStart();
32 | if (PlayServicesUtils.isGooglePlayStoreAvailable(this)) {
33 | PlayServicesUtils.handleAnyPlayServicesError(this);
34 | }
35 | }
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | if (Global.isMissingCredentials()) {
41 | setContentView(R.layout.missing_credentials);
42 | return;
43 | }
44 | setContentView(R.layout.activity_main);
45 |
46 | /**
47 | * This will make a full-screen feedback screen appear. It is very similar to how
48 | * the feedback dialog works but it is hosted in an activity.
49 | */
50 | findViewById(R.id.main_btn_contact).setOnClickListener(new View.OnClickListener() {
51 | @Override
52 | public void onClick(View view) {
53 | RequestActivity.builder().show(MainActivity.this);
54 | }
55 | });
56 |
57 | /**
58 | * This will launch an Activity that will show the current Requests that a
59 | * user has opened.
60 | */
61 | findViewById(R.id.main_btn_request_list).setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View view) {
64 | RequestListActivity.builder().show(MainActivity.this);
65 |
66 | }
67 | });
68 |
69 | findViewById(R.id.main_btn_support).setOnClickListener(new View.OnClickListener() {
70 | @Override
71 | public void onClick(View v) {
72 | HelpCenterActivity.builder().show(MainActivity.this);
73 | }
74 | });
75 |
76 | final EditText devicePushToken = findViewById(R.id.main_edittext_push);
77 |
78 | findViewById(R.id.main_btn_push_register).setOnClickListener(new View.OnClickListener() {
79 | @Override
80 | public void onClick(View v) {
81 | Zendesk.INSTANCE.provider().pushRegistrationProvider().registerWithUAChannelId(devicePushToken.getText().toString(), new ZendeskCallback() {
82 | @Override
83 | public void onSuccess(String result) {
84 | Toast.makeText(getApplicationContext(), "Registration success", Toast.LENGTH_SHORT).show();
85 | }
86 |
87 | @Override
88 | public void onError(ErrorResponse error) {
89 | Toast.makeText(getApplicationContext(), "Registration failure: " + error.getReason(), Toast.LENGTH_SHORT).show();
90 | }
91 | });
92 | }
93 | });
94 |
95 | findViewById(R.id.main_btn_push_unregister).setOnClickListener(new View.OnClickListener() {
96 | @Override
97 | public void onClick(View v) {
98 | Zendesk.INSTANCE.provider().pushRegistrationProvider().unregisterDevice(new ZendeskCallback() {
99 | @Override
100 | public void onSuccess(Void result) {
101 | Toast.makeText(getApplicationContext(), "Deregistration success", Toast.LENGTH_SHORT).show();
102 | }
103 |
104 | @Override
105 | public void onError(ErrorResponse error) {
106 | Toast.makeText(getApplicationContext(), "Deregistration failure: " + error.getReason(), Toast.LENGTH_SHORT).show();
107 | }
108 | });
109 | }
110 | });
111 |
112 |
113 | /*
114 | The channelId could be null on initial app start:
115 |
116 | According to the Urban Airship docs:
117 | > The Channel ID is your application’s unique push identifier, and
118 | > is required in order to target a specific device when sending a push notification.
119 | > Don’t worry if this value initially comes back as null on your app’s first run
120 | > (or after clearing the application data),
121 | > as the Channel ID will be created and persisted during registration.
122 | > (http://docs.urbanairship.com/platform/android.html)
123 | */
124 |
125 | final String channelId = UAirship.shared().getPushManager().getChannelId();
126 | Logger.d(LOG_TAG, String.format(Locale.US, "Urban Airship - Channel Id %s", channelId));
127 | ((EditText) findViewById(R.id.main_edittext_push)).setText(channelId);
128 | }
129 | }
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_urbanairship_sample/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_urbanairship_sample/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_urbanairship_sample/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/support_urbanairship_sample/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/drawable/ic_chat_bubble.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
22 |
23 |
28 |
29 |
34 |
35 |
41 |
42 |
47 |
48 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2196F3
4 | #1976D2
5 | #FFC107
6 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SDK Sample UA
5 | Ticket List
6 | Support
7 | Contact Zendesk
8 |
9 | Push device token
10 | Register Push
11 | Unregister Push
12 |
13 | You must provide a valid Zendesk subdomain url, application id, and oauth client id for this demo to function
14 |
15 |
16 |
--------------------------------------------------------------------------------
/support_urbanairship_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/talk_sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/talk_sample/README.md:
--------------------------------------------------------------------------------
1 | ## Getting started
2 |
3 | To begin using the demo app, you need to configure four essential parameters in the [SampleApplication](https://github.com/zendesk/android_sdk_demo_apps/blob/master/talk_sample/src/main/java/com/zendesk/talk/sample/SampleApplication.kt) file. These parameters are crucial for enabling call functionality within the sample app:
4 |
5 | - SUBDOMAIN_URL: Your Zendesk subdomain URL.
6 | - APPLICATION_ID: The unique identifier for your application.
7 | - OAUTH_CLIENT_ID: The client ID for OAuth authentication.
8 | - DIGITAL_LINE: The nickname of the digital line you will use.
9 |
10 | Follow the steps below to set up these parameters:
11 |
12 | 1. Log in to your Zendesk account
13 | 2. Navigate to "Admin Center" > "Channels" > "Classic" > "Mobile SDK" to [Register an app in Zendesk Support](https://developer.zendesk.com/documentation/classic-web-widget-sdks/talk-sdk/android/getting_started/#registering-your-app-in-zendesk-support) to get these 3 parameters (SUBDOMAIN_URL, APPLICATION_ID, OAUTH_CLIENT_ID)
14 | 3. Add your app
15 | 4. Once your app is registered, you can find the Zendesk URL, App ID, and Client ID in the app settings.
16 | 5. Navigate to "Admin Center" > "Channels" > "Talk and email" > Lines tab
17 | 6. Here, create a new digital line and choose a nickname for it. This nickname will be used as your DIGITAL_LINE.
18 | 7. After configuring these settings, you are all set to start making calls.
19 |
20 | Feel free to check the [official documentation](https://developer.zendesk.com/documentation/classic-web-widget-sdks/talk-sdk/android/getting_started/)
--------------------------------------------------------------------------------
/talk_sample/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | namespace "com.zendesk.talk.sample"
8 | compileSdkVersion rootProject.ext.compileSdkVersion
9 |
10 | defaultConfig {
11 | applicationId rootProject.ext.applicationId + "talk.sample"
12 | minSdkVersion rootProject.ext.minSdkVersion
13 | targetSdkVersion rootProject.ext.targetSdkVersion
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | kotlin {
27 | jvmToolchain(17)
28 | }
29 | compileOptions {
30 | sourceCompatibility JavaVersion.VERSION_17
31 | targetCompatibility JavaVersion.VERSION_17
32 | }
33 |
34 | buildFeatures {
35 | viewBinding true
36 | }
37 | }
38 |
39 | dependencies {
40 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
41 | implementation group: 'com.getkeepsafe.relinker', name: 'relinker', version: '1.4.2'
42 | implementation group:"zendesk.talk", name:"talk-android", version: rootProject.ext.talkSdkVersion
43 | implementation group:"androidx.constraintlayout", name:"constraintlayout", version: rootProject.ext.constraintlayoutVersion
44 | implementation group:"androidx.lifecycle", name:"lifecycle-runtime-ktx", version: rootProject.ext.lifecycleVersion
45 | implementation project(":demo_apps_commons")
46 | }
47 |
--------------------------------------------------------------------------------
/talk_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/talk_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/talk_sample/src/main/java/com/zendesk/talk/sample/LineStatusChecker.kt:
--------------------------------------------------------------------------------
1 | package com.zendesk.talk.sample
2 |
3 | import zendesk.talk.android.LineStatusResult
4 |
5 | class LineStatusChecker {
6 |
7 | suspend fun lineStatus(): Boolean {
8 | return when (val lineStatus = SampleApplication.talk?.lineStatus(SampleApplication.DIGITAL_LINE)) {
9 | is LineStatusResult.Success -> lineStatus.agentAvailable
10 | is LineStatusResult.Failure -> false
11 | null -> false
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/talk_sample/src/main/java/com/zendesk/talk/sample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.zendesk.talk.sample
2 |
3 | import android.os.Bundle
4 | import android.view.Menu
5 | import android.view.MenuItem
6 | import android.view.View
7 | import android.widget.Toast
8 | import androidx.appcompat.app.AppCompatActivity
9 | import androidx.lifecycle.lifecycleScope
10 | import com.zendesk.talk.sample.databinding.ActivityMainBinding
11 | import kotlinx.coroutines.launch
12 |
13 | class MainActivity : AppCompatActivity() {
14 |
15 | private lateinit var binding: ActivityMainBinding
16 |
17 | private val lineStatusChecker = LineStatusChecker()
18 |
19 | private var lineAvailable: Boolean = false
20 |
21 | override fun onCreate(savedInstanceState: Bundle?) {
22 | super.onCreate(savedInstanceState)
23 | binding = ActivityMainBinding.inflate(layoutInflater)
24 | setContentView(binding.root)
25 | binding.setMissingCredentials(SampleApplication.isMissingCredentials())
26 |
27 | binding.checkLineStatus.setOnClickListener {
28 | Toast.makeText(this, R.string.line_status_checking, Toast.LENGTH_SHORT).show()
29 | lifecycleScope.launch {
30 | lineAvailable = lineStatusChecker.lineStatus()
31 | invalidateOptionsMenu()
32 | val message = if (lineAvailable) R.string.line_available else R.string.line_not_available
33 | Toast.makeText(this@MainActivity, message, Toast.LENGTH_SHORT).show()
34 | }
35 | }
36 | }
37 |
38 | override fun onCreateOptionsMenu(menu: Menu?): Boolean {
39 | if (!SampleApplication.isMissingCredentials()
40 | && lineAvailable
41 | && SampleApplication.DIGITAL_LINE.isNotEmpty()
42 | ) {
43 | menuInflater.inflate(R.menu.main_activity_menu, menu)
44 | return true
45 | }
46 | return false
47 | }
48 |
49 | override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) {
50 | R.id.call_agent -> {
51 | SampleApplication.talk?.startCallSetupFlow(
52 | context = this,
53 | digitalLine = SampleApplication.DIGITAL_LINE,
54 | successIntent = null
55 | )
56 | true
57 | }
58 | else -> super.onOptionsItemSelected(item)
59 | }
60 |
61 | private fun ActivityMainBinding.setMissingCredentials(missing: Boolean) {
62 | val views = listOf(chatBubble, line1, queuePosition, line2, messageDivider, chatForm, send, checkLineStatus)
63 | val viewsVisibility = if (missing) View.GONE else View.VISIBLE
64 | views.forEach { view -> view.visibility = viewsVisibility }
65 | missingCredentials.visibility = if (missing) View.VISIBLE else View.GONE
66 | }
67 | }
--------------------------------------------------------------------------------
/talk_sample/src/main/java/com/zendesk/talk/sample/SampleApplication.kt:
--------------------------------------------------------------------------------
1 | package com.zendesk.talk.sample
2 |
3 | import android.app.Application
4 | import com.zendesk.logger.Logger
5 | import zendesk.core.AnonymousIdentity
6 | import zendesk.core.Zendesk
7 | import zendesk.talk.android.Talk
8 |
9 | class SampleApplication : Application() {
10 |
11 | companion object {
12 | private const val SUBDOMAIN_URL = ""
13 | private const val APPLICATION_ID = ""
14 | private const val OAUTH_CLIENT_ID = ""
15 |
16 | // set your digital line name
17 | const val DIGITAL_LINE = ""
18 |
19 | private val CREDENTIALS = listOf(SUBDOMAIN_URL, APPLICATION_ID, OAUTH_CLIENT_ID)
20 |
21 | var talk: Talk? = null
22 | private set
23 |
24 | fun isMissingCredentials() = CREDENTIALS.any { credential -> credential.isEmpty() }
25 | }
26 |
27 | override fun onCreate() {
28 | super.onCreate()
29 |
30 | // Enable logging
31 | Logger.setLoggable(true)
32 |
33 | if (isMissingCredentials()) {
34 | return
35 | }
36 |
37 | /**
38 | * Initialize the SDK with your Zendesk subdomain, mobile SDK app ID, and client ID.
39 | *
40 | * Get these details from your Zendesk dashboard: Admin -> Channels -> MobileSDK.
41 | */
42 | Zendesk.INSTANCE.init(
43 | this,
44 | SUBDOMAIN_URL,
45 | APPLICATION_ID,
46 | OAUTH_CLIENT_ID
47 | )
48 |
49 | /**
50 | * Set an identity (authentication).
51 | *
52 | * Talk SDK supports only Anonymous identity
53 | */
54 | Zendesk.INSTANCE.setIdentity(
55 | AnonymousIdentity.Builder()
56 | .withNameIdentifier("{optional name}")
57 | .withEmailIdentifier("{optional email}")
58 | .build()
59 | )
60 |
61 | talk = Talk.create(Zendesk.INSTANCE)
62 | }
63 | }
--------------------------------------------------------------------------------
/talk_sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/drawable/chat_bubble.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/drawable/ic_baseline_phone_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/drawable/ic_baseline_send_24.xml:
--------------------------------------------------------------------------------
1 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
23 |
24 |
35 |
36 |
47 |
48 |
60 |
61 |
70 |
71 |
79 |
80 |
92 |
93 |
102 |
103 |
116 |
117 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/menu/main_activity_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/android_sdk_demo_apps/ca8a900164e4a6b2413b44ba5013ae54dae5f219/talk_sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/talk_sample/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #BB86FC
4 | #6200EE
5 | #3700B3
6 | #03DAC5
7 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Talk sample
3 | Call agent
4 | Type a message...
5 | Queue position: 2
6 | Hello
7 | Failed to provide valid credentials for this demo app
8 | Check line status
9 | Checking line status...
10 | Line available
11 | Line not available
12 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/talk_sample/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------