jitsi / jitsi-meet-sdk-samples

Jitsi Meet mobile SDK examples (Android, iOS and React Native)
Apache License 2.0
277 stars 240 forks source link

Android JitsiMeetView return to calling activity onConferenceTerminated #53

Closed sumitsoman closed 4 years ago

sumitsoman commented 4 years ago

I start a jitsi video call using CustomJitsiMeetActivity from a notification button click using PendingIntentas

Intent intent = new Intent(this, CustomJitsiMeetActivity.class);
    intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
            PendingIntent.FLAG_ONE_SHOT);

    Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
            .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.ic_stat_name))
            .setSmallIcon(R.drawable.ic_stat_name)
            .setContentTitle(notification.getTitle())
            .setContentText(notification.getBody())
            .setAutoCancel(true)
            .setSound(defaultSoundUri)
            .setContentIntent(pendingIntent)
            .setColor(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary))
            .addAction(R.drawable.ic_stat_name, getString(R.string.JOIN_CALL),
                    pendingIntent);

I need to return to MainActivity after the call ends from CustomJitsiMeetActivity which extends Fragment and implements JitsiMeetActivityInterface and JitsiMeetViewListener. This is the code for onCreate() method in CustomJitsiMeetActivity

private JitsiMeetView view;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    view = new JitsiMeetView(this);
    JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
            .setRoom(getString(R.string.CALL_URL))
            .setSubject(getString(R.string.CALL_TITLE))
            .build();
    view.join(options);

    setContentView(view);
}

Once I disconnect the call the progress spinner keeps showing and I am unable to return to MainActivity even when I start a new Intent in onConferenceTerminated() after calling finish(). What is the correct way to do this?

erandakarachchi commented 4 years ago

This answer on jitsi-meet might help you.

sunilkumarjena21 commented 4 years ago

Hi @erandakarachchi @saghul ,

After implementing this custom activity 'onConferenceTerminated' & 'onConferenceJoined' working perfectly fine. Issue I'm facing:The camera & microphone is not working in this case unlike the ' JitsiMeetActivity.launch(context, options)' case. Even its not asking for the dynamic permissions when tapping on the microphone & Camera icons.

Any guess on the issue?

Thanks in advance!

erandakarachchi commented 3 years ago

@sunilkumarjena21 updating the library version worked for me.