Skip to content

Commit

Permalink
Upgrade to jitsi meet 1.21.0 on android
Browse files Browse the repository at this point in the history
  • Loading branch information
skrafft committed Feb 1, 2019
1 parent 91a4300 commit fee2c66
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 13 deletions.
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ repositories {
}

dependencies {
implementation ('org.jitsi.react:jitsi-meet-sdk:1.16+') {
//resolutionStrategy.force "org.webkit:android-jsc:r224109"
implementation ('org.jitsi.react:jitsi-meet-sdk:1.21.0') {
transitive = true
compile ("org.webkit:android-jsc:r224109") { force = true }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,44 @@
import java.util.Map;
import java.util.HashMap;

import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;

import com.facebook.react.ReactInstanceManager;
import com.facebook.react.modules.core.PermissionListener;

import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.ReadableMap;

import org.jitsi.meet.sdk.JitsiMeetView;
import org.jitsi.meet.sdk.JitsiMeetViewListener;
import org.jitsi.meet.sdk.ReactActivityLifecycleCallbacks;

public class JitsiMeetNavigatorActivity extends AppCompatActivity implements JitsiMeetViewListener{

/**
* Instance of the {@link JitsiMeetView} which this activity will display.
*/
private JitsiMeetView view;


@Override
protected void onActivityResult(
int requestCode,
int resultCode,
Intent data) {
ReactActivityLifecycleCallbacks.onActivityResult(
this, requestCode, resultCode, data);
}

@Override
public void onBackPressed() {
if (!JitsiMeetView.onBackPressed()) {
// Invoke the default handler if it wasn't handled by React.
super.onBackPressed();
}
ReactActivityLifecycleCallbacks.onBackPressed();
}

@Override
Expand All @@ -41,29 +59,47 @@ protected void onCreate(Bundle savedInstanceState) {
protected void onDestroy() {
super.onDestroy();

view.dispose();
view = null;
if (view != null) {
view.dispose();
view = null;
}

JitsiMeetView.onHostDestroy(this);
ReactActivityLifecycleCallbacks.onHostDestroy(this);
}

@Override
public void onNewIntent(Intent intent) {
JitsiMeetView.onNewIntent(intent);
ReactActivityLifecycleCallbacks.onNewIntent(intent);
}

// https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback
@Override
public void onRequestPermissionsResult(
final int requestCode,
final String[] permissions,
final int[] grantResults) {
ReactActivityLifecycleCallbacks.onRequestPermissionsResult(requestCode, permissions, grantResults);
}

@Override
protected void onResume() {
super.onResume();

JitsiMeetView.onHostResume(this);
ReactActivityLifecycleCallbacks.onHostResume(this);
}

@Override
protected void onStop() {
public void onStop() {
super.onStop();

JitsiMeetView.onHostPause(this);
ReactActivityLifecycleCallbacks.onHostPause(this);
}

@Override
protected void onUserLeaveHint() {
if (view != null) {
view.enterPictureInPicture();
}
}

private void on(String name, Map<String, Object> data) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-jitsi-meet",
"description": "Jitsi Meet SDK wrapper for React Native.",
"version": "1.0.7",
"version": "1.1.0",
"author": {
"name": "Sébastien Krafft",
"email": "[email protected]"
Expand Down

0 comments on commit fee2c66

Please sign in to comment.