-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from voxeet/feature/android_fix_invitation
Feature/android fix invitation
- Loading branch information
Showing
18 changed files
with
413 additions
and
937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/android/com/voxeet/toolkit/CordovaActivityWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.voxeet.toolkit; | ||
|
||
import android.content.Intent; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import com.voxeet.sdk.events.sdk.ConferenceStatusUpdatedEvent; | ||
import com.voxeet.uxkit.common.activity.VoxeetCommonAppCompatActivityWrapper; | ||
import com.voxeet.uxkit.common.activity.bundle.DefaultIncomingBundleChecker; | ||
import com.voxeet.uxkit.common.activity.bundle.IncomingBundleChecker; | ||
import com.voxeet.uxkit.service.VoxeetSystemService; | ||
|
||
public class CordovaActivityWrapper extends VoxeetCommonAppCompatActivityWrapper<VoxeetSystemService> { | ||
public CordovaActivityWrapper(@NonNull AppCompatActivity parentActivity) { | ||
super(parentActivity); | ||
} | ||
|
||
@Override | ||
protected void onSdkServiceAvailable() { | ||
|
||
} | ||
|
||
@Override | ||
protected void onConferenceState(@NonNull ConferenceStatusUpdatedEvent conferenceStatusUpdatedEvent) { | ||
|
||
} | ||
|
||
@Override | ||
protected boolean canBeRegisteredToReceiveCalls() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public IncomingBundleChecker createIncomingBundleChecker(@Nullable Intent intent) { | ||
if(null == intent) return new DefaultIncomingBundleChecker(new Intent(), null); | ||
return new DefaultIncomingBundleChecker(intent, null); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/android/com/voxeet/toolkit/CordovaPermissionHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.voxeet.toolkit; | ||
|
||
import android.Manifest; | ||
|
||
import com.voxeet.promise.Promise; | ||
import com.voxeet.uxkit.common.permissions.PermissionController; | ||
import com.voxeet.uxkit.common.permissions.PermissionResult; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class CordovaPermissionHelper { | ||
|
||
private final static List<String> PERMISSIONS = Arrays.asList(Manifest.permission.RECORD_AUDIO, Manifest.permission.CAMERA); | ||
|
||
public static Promise<Boolean> requestDefaultPermission() { | ||
return new Promise<>(solver -> { | ||
|
||
PermissionController.requestPermissions(PERMISSIONS).then(permissionResults -> { | ||
for (PermissionResult res : permissionResults) { | ||
if (res.isFor(Manifest.permission.RECORD_AUDIO) && !res.isGranted) { | ||
solver.resolve(false); | ||
return; | ||
} | ||
} | ||
solver.resolve(true); | ||
}).error(solver::reject); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.