Skip to content

Commit

Permalink
Added 2.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-shin committed Aug 3, 2022
1 parent f9f8cb2 commit a3313ac
Show file tree
Hide file tree
Showing 39 changed files with 593 additions and 415 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

### v2.2.6 (Aug 3, 2022) with Core SDK `v3.1.18`
* Support Android 13
* Set the `maxSdkVersion` of `android.permission.READ_EXTERNAL_STORAGE` to `32`
* Removed `android.permission.REQUEST_INSTALL_PACKAGES` permission
* Improved stability.

### v2.2.5 (Mar 29, 2022) with Core SDK `v3.1.9`
* Improved stability.

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

## Introduction

The new version of the Sendbird UIKit is now available as the beta. Compared to UIKit v2, UIKit v3 beta features a new modular architecture with more granular components that give you enhanced flexibility to customize your web and mobile apps. Check out our [migration guides](https://github.com/sendbird/sendbird-uikit-android/blob/v3-beta/changelogs/MIGRATIONGUIDE_V3.md) and go visit the [v3 branch](https://github.com/sendbird/sendbird-uikit-android/tree/v3-beta) here.

Sendbird UIKit for Android is a development kit with an user interface that enables an easy and fast integration of standard chat features into new or existing client apps. This repository houses the UIKit source code in addition to two samples as explained below.

- **uikit** is where you can find the open source code. Check out [UIKit Open Source Guidelines](https://github.com/sendbird/sendbird-uikit-android-sources/blob/main/OPENSOURCE_GUIDELINES.md) for more information regarding our stance on open source.
- **uikit-sample** is a chat app with UIKit’s core core features in which you can see items such as push notifications, total unread message count and auto sign-in are demonstrated. When you sign in to the sample app, you will only see a list of channels rendered by the [ChannelListActivity](https://sendbird.com/docs/uikit/v1/android/guides/group-channel#2-list-channels) on the screen.
- **uikit** is where you can find the open source code. Check out [UIKit Open Source Guidelines](https://github.com/sendbird/sendbird-uikit-android-sources/blob/main-v2/OPENSOURCE_GUIDELINES.md) for more information regarding our stance on open source.
- **uikit-sample** is a chat app with UIKit’s core core features in which you can see items such as push notifications, total unread message count and auto sign-in are demonstrated. When you sign in to the sample app, you will only see a list of channels rendered by the [ChannelListActivity](https://sendbird.com/docs/uikit/v1/android/guides/group-channel#2-list-channels) on the screen.
- **uikit-custom-sample** is a chat app which contains customizable sample code for the following:
* An example of how you can create your own custom message type, for example, a demonstration of sending a message in highlight.
* MessageListParams provides various options for retrieving a list of messages with `MessageListParams`
Expand Down Expand Up @@ -39,7 +37,7 @@ The minimum requirements for UIKit for Android are:

### Try the sample app using your data

If you would like to try the sample app specifically fit to your usage, you can do so by replacing the default sample app ID with yours, which you can obtain by [creating your Sendbird application from the dashboard](https://docs.sendbird.com/android/quick_start#3_install_and_configure_the_chat_sdk_4_step_1_create_a_sendbird_application_from_your_dashboard). Furthermore, you could also add data of your choice on the dashboard to test. This will allow you to experience the sample app with data from your Sendbird application.
If you would like to try the sample app specifically fit to your usage, you can do so by replacing the default sample app ID with yours, which you can obtain by [creating your Sendbird application from the dashboard](https://sendbird.com/docs/chat/v3/android/quickstart/send-first-message#2-before-you-start). Furthermore, you could also add data of your choice on the dashboard to test. This will allow you to experience the sample app with data from your Sendbird application.

<br />

Expand Down Expand Up @@ -129,4 +127,4 @@ Here is an overview of a list of key components that can be customized on UIKit.
|CreateChannel|A component that shows all the users in your client app so you can create a channel. Users can be selected from this component to begin chatting.|
|InviteChannel|A component that shows all the users of your client app from the current channel so you can invite other users to join. |
|ChannelSettings|A component that changes the channel information.|
|MemberList|A component that shows the list of members who have joined the current channel.|
|MemberList|A component that shows the list of members who have joined the current channel.|
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
buildscript {
repositories {
google()
jcenter()

mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:7.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

Expand All @@ -17,9 +16,8 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://repo.sendbird.com/public/maven" }
}
}

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enablerD8=true

UIKIT_VERSION = 2.2.5
UIKIT_VERSION = 2.2.6
UIKIT_VERSION_CODE = 1

6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jan 02 16:41:55 KST 2020
#Tue Jul 19 13:26:03 KST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
zipStoreBase=GRADLE_USER_HOME
34 changes: 9 additions & 25 deletions uikit-custom-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
compileSdkVersion 33

defaultConfig {
applicationId "com.sendbird.uikit.customsample"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 33
versionCode 1
versionName "1.0"
multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
buildConfigField "String", "VERSION_NAME", "\"$UIKIT_VERSION\""
}

compileOptions {
Expand All @@ -35,23 +26,16 @@ android {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
// implementation project(":uikit")
implementation "com.sendbird.sdk:uikit:2.2.5"
implementation project(":uikit")
// implementation "com.sendbird.sdk:uikit:$UIKIT_VERSION"

implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.google.firebase:firebase-messaging:21.0.0'

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

implementation 'com.google.android.material:material:1.2.1'

implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.2.0'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
}
3 changes: 2 additions & 1 deletion uikit-custom-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.sendbird.uikit.customsample">
<uses-permission android:name="android.permission.VIBRATE" android:maxSdkVersion="18"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application
android:name=".BaseApplication"
Expand Down Expand Up @@ -45,7 +46,7 @@
android:name=".LoginActivity"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity android:name=".SplashActivity">
<activity android:name=".SplashActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
package com.sendbird.uikit.customsample;

import android.Manifest;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;

import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.PermissionChecker;
import androidx.databinding.DataBindingUtil;

import com.sendbird.android.GroupChannelTotalUnreadMessageCountParams;
Expand All @@ -22,16 +33,23 @@
import com.sendbird.uikit.customsample.openchannel.OpenChannelMainActivity;
import com.sendbird.uikit.customsample.utils.PreferenceUtils;
import com.sendbird.uikit.customsample.utils.PushUtils;
import com.sendbird.uikit.utils.ContextUtils;
import com.sendbird.uikit.widgets.WaitingDialog;

import java.util.List;
import java.util.Locale;
import java.util.Map;


public class HomeActivity extends AppCompatActivity {
private ActivityHomeBinding binding;
private static final String USER_EVENT_HANDLER_KEY = "USER_EVENT_HANDLER_KEY" + System.currentTimeMillis();

@NonNull
private final ActivityResultLauncher<String> requestPermissionLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> {});
@NonNull
private final ActivityResultLauncher<Intent> appSettingLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), intent -> {});

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -45,6 +63,18 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

binding.tvUnreadCount.setTextAppearance(this, R.style.SendbirdCaption3OnDark01);
binding.tvUnreadCount.setBackgroundResource(R.drawable.shape_badge_background);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
final String permission = Manifest.permission.POST_NOTIFICATIONS;
if (ContextCompat.checkSelfPermission(this, permission) == PermissionChecker.PERMISSION_GRANTED) {
return;
}
if (ActivityCompat.shouldShowRequestPermissionRationale(this, permission)) {
showPermissionRationalePopup();
return;
}
requestPermissionLauncher.launch(permission);
}
}

@Override
Expand Down Expand Up @@ -120,4 +150,22 @@ public void onError(SendBirdException e) {
}
});
}

private void showPermissionRationalePopup() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(com.sendbird.uikit.R.string.sb_text_dialog_permission_title));
builder.setMessage(String.format(Locale.US, getString(R.string.sb_text_need_to_allow_permission_notification), ContextUtils.getApplicationName(this)));
builder.setPositiveButton(com.sendbird.uikit.R.string.sb_text_go_to_settings, (dialogInterface, i) -> {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setData(Uri.parse("package:" + getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
appSettingLauncher.launch(intent);
});
AlertDialog dialog = builder.create();
dialog.show();
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(ContextCompat.getColor(this, com.sendbird.uikit.R.color.secondary_300));
}
}
Loading

0 comments on commit a3313ac

Please sign in to comment.