Skip to content

Commit

Permalink
Update to 1.2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
sf-tyler-jeong committed Jul 17, 2020
1 parent c031cdb commit 8dc5c71
Show file tree
Hide file tree
Showing 19 changed files with 592 additions and 427 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.sendbird.calls.quickstart"
minSdkVersion 16 // [Calls]
targetSdkVersion 29
versionCode 6
versionName "1.1.3"
versionCode 7
versionName "1.2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -31,9 +31,9 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'

implementation 'com.sendbird.sdk:sendbird-calls:1.1.3' // [Calls]
implementation 'com.google.firebase:firebase-core:17.4.3' // [Calls] FCM
implementation 'com.google.firebase:firebase-messaging:20.2.0' // [Calls] FCM
implementation 'com.sendbird.sdk:sendbird-calls:1.2.0' // [Calls]
implementation 'com.google.firebase:firebase-core:17.4.4' // [Calls] FCM
implementation 'com.google.firebase:firebase-messaging:20.2.3' // [Calls] FCM
implementation 'com.github.bumptech.glide:glide:4.11.0'

//+ [QRCode]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
import com.sendbird.calls.SendBirdCall;
import com.sendbird.calls.handler.DirectCallListener;
import com.sendbird.calls.handler.SendBirdCallListener;
import com.sendbird.calls.quickstart.call.CallActivity;
import com.sendbird.calls.quickstart.call.CallService;
import com.sendbird.calls.quickstart.utils.BroadcastUtils;
import com.sendbird.calls.quickstart.utils.PrefUtils;

import java.util.UUID;

public class BaseApplication extends Application {

public static final String VERSION = "1.1.3";
public static final String VERSION = "1.2.0";

private static final String TAG = "BaseApplication";
public static final String TAG = "SendBirdCalls";

// Refer to "https://github.com/sendbird/quickstart-calls-android".
public static final String APP_ID = "YOUR_APPLICATION_ID";

@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate()");
Log.i(BaseApplication.TAG, "[BaseApplication] onCreate()");

initSendBirdCall(PrefUtils.getAppId(getApplicationContext()));
}

public boolean initSendBirdCall(String appId) {
Log.d(TAG, "initSendBirdCall(appId: " + appId + ")");
Log.i(BaseApplication.TAG, "[BaseApplication] initSendBirdCall(appId: " + appId + ")");
Context context = getApplicationContext();

if (TextUtils.isEmpty(appId)) {
Expand All @@ -46,8 +46,10 @@ public boolean initSendBirdCall(String appId) {
SendBirdCall.addListener(UUID.randomUUID().toString(), new SendBirdCallListener() {
@Override
public void onRinging(DirectCall call) {
Log.d(TAG, "onRinging() => callId: " + call.getCallId());
if (CallActivity.sIsRunning) {
int ongoingCallCount = SendBirdCall.getOngoingCallCount();
Log.i(BaseApplication.TAG, "[BaseApplication] onRinging() => callId: " + call.getCallId() + ", getOngoingCallCount(): " + ongoingCallCount);

if (ongoingCallCount >= 2) {
call.end();
return;
}
Expand All @@ -59,13 +61,18 @@ public void onConnected(DirectCall call) {

@Override
public void onEnded(DirectCall call) {
if (!CallActivity.sIsRunning) {
int ongoingCallCount = SendBirdCall.getOngoingCallCount();
Log.i(BaseApplication.TAG, "[BaseApplication] onEnded() => callId: " + call.getCallId() + ", getOngoingCallCount(): " + ongoingCallCount);

BroadcastUtils.sendCallLogBroadcast(context, call.getCallLog());

if (ongoingCallCount == 0) {
CallService.stopService(context);
}
}
});

CallService.startService(context, call, true);
CallService.onRinging(context, call);
}
});
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.sendbird.calls.quickstart;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
Expand All @@ -24,7 +23,6 @@
public class SignInManuallyActivity extends AppCompatActivity {

private Context mContext;
private Activity mParentActivity;
private InputMethodManager mInputMethodManager;

private TextInputLayout mTextInputLayoutAppId;
Expand All @@ -41,7 +39,6 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_sign_in_manually);

mContext = this;
mParentActivity = getParent();
mInputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);

initViews();
Expand Down
Loading

0 comments on commit 8dc5c71

Please sign in to comment.