Skip to content

Commit

Permalink
Merge pull request #60 from webex/Release/3.9.1
Browse files Browse the repository at this point in the history
v3.9.1 Release
  • Loading branch information
raghsund authored Jun 19, 2023
2 parents 05c75ff + 2043cd7 commit 72413ec
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 38 deletions.
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ android {
applicationId "com.cisco.sdk_android"
minSdkVersion Versions.minSdk
targetSdkVersion Versions.targetSdk
versionCode 39000
versionName "3.9.0"
versionCode 39100
versionName "3.9.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "CLIENT_ID", "${CLIENT_ID}"
buildConfigField "String", "CLIENT_SECRET", "${CLIENT_SECRET}"
buildConfigField "String", "SCOPE", "${SCOPE}"
buildConfigField "String", "REDIRECT_URI", "${REDIRECT_URI}"

buildConfigField "String", "FEDRAMP_CLIENT_ID", "${FEDRAMP_CLIENT_ID}"
buildConfigField "String", "FEDRAMP_CLIENT_SECRET", "${FEDRAMP_CLIENT_SECRET}"
buildConfigField "String", "FEDRAMP_REDIRECT_URI", "${FEDRAMP_REDIRECT_URI}"

buildConfigField "String", "WEBHOOK_URL", "${WEBHOOK_URL}"
}

buildTypes {
Expand Down Expand Up @@ -87,11 +90,8 @@ android {
}

dependencies {

// At a time only one WebexSDK should be used.
implementation 'com.ciscowebex:webexsdk-wxc:3.9.0' //For webexCalling flavor
//implementation 'com.ciscowebex:webexsdk-meeting:3.9.0' // For meeting flavor
//implementation 'com.ciscowebex:webexsdk:3.9.0' // For full flavor
// implementation(project(path: ":sdk"))
implementation 'com.ciscowebex:webexsdk:3.9.1'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation Dependencies.kotlinStdLib
implementation Dependencies.coreKtx
Expand Down
58 changes: 58 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,64 @@
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:707417346294:android:aa272fce42068b73d19cd7",
"android_client_info": {
"package_name": "com.cisco.sdk_android.sample.kitchensink"
}
},
"oauth_client": [
{
"client_id": "707417346294-sc7gohgcphcumbm6nvf1541rij58ouse.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDAioUqm-U11HAfDkk1RTAtJ_u2lfjQSLE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "707417346294-sc7gohgcphcumbm6nvf1541rij58ouse.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:707417346294:android:e225de5f56489e9cd19cd7",
"android_client_info": {
"package_name": "com.cisco.sdk_android.wxc"
}
},
"oauth_client": [
{
"client_id": "707417346294-sc7gohgcphcumbm6nvf1541rij58ouse.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDAioUqm-U11HAfDkk1RTAtJ_u2lfjQSLE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "707417346294-sc7gohgcphcumbm6nvf1541rij58ouse.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ import com.ciscowebex.androidsdk.membership.Membership
import com.ciscowebex.androidsdk.membership.MembershipObserver
import com.ciscowebex.androidsdk.message.LocalFile
import com.ciscowebex.androidsdk.message.MessageObserver
import com.ciscowebex.androidsdk.phone.Breakout
import com.ciscowebex.androidsdk.phone.BreakoutSession
import com.ciscowebex.androidsdk.phone.Call
import com.ciscowebex.androidsdk.phone.CallMembership
import com.ciscowebex.androidsdk.phone.MediaOption
import com.ciscowebex.androidsdk.phone.Phone
import com.ciscowebex.androidsdk.phone.VirtualBackground
import com.ciscowebex.androidsdk.phone.CallObserver
import com.ciscowebex.androidsdk.phone.NotificationCallType
import com.ciscowebex.androidsdk.phone.*
import com.ciscowebex.androidsdk.space.SpaceObserver
import java.io.PrintWriter

Expand Down Expand Up @@ -658,6 +650,15 @@ class WebexRepository(val webex: Webex) : WebexUCLoginDelegate {
}
}
}

override fun onReceivingNoiseInfoChanged(info: ReceivingNoiseInfo) {
val observers: MutableList<CallObserver>? = _callObservers[_callId]
observers?.let { it ->
it.forEach { observer ->
observer.onReceivingNoiseInfoChanged(info)
}
}
}
}

private fun registerCallObserver(call: Call) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,9 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi
}

fun setPushTokens(id: String, token: String){
webex.phone.setPushTokens(KitchenSinkApp.applicationContext().packageName, id, token)
if(BuildConfig.WEBHOOK_URL.isEmpty()) {
webex.phone.setPushTokens(KitchenSinkApp.applicationContext().packageName, id, token)
}
}

fun getFCMToken(personModel: PersonModel) {
Expand Down Expand Up @@ -759,9 +761,10 @@ class WebexViewModel(val webex: Webex, val repository: WebexRepository) : BaseVi

private fun sendTokenToServer(it: Pair<String?, PersonModel>) {
val json = JSONObject()
json.put("token", it.first)
json.put("personId", it.second.personId)
json.put("email", it.second.emailList)
json.put("pushProvider", "FCM")
json.put("deviceToken", it.first)
json.put("userId", it.second.encodedId)
//json.put("voipToken", "NA")
RegisterTokenService().execute(json.toString())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ class CallControlsFragment : Fragment(), OnClickListener, CallObserverInterface

override fun onConnected(call: Call?) {
Log.d(TAG, "CallObserver onConnected callId: ${call?.getCallId()}, hasAnyoneJoined: ${webexViewModel.hasAnyoneJoined()}, " +
"correlationId: ${call?.getCorrelationId()}"+
"isMeeting: ${webexViewModel.isMeeting()}," +
"isPmr: ${webexViewModel.isPmr()}," +
"isSelfCreator: ${webexViewModel.isSelfCreator()}," +
"isSpaceMeeting: ${webexViewModel.isSpaceMeeting()}"+
"correlationId: ${call?.getCorrelationId()}, "+
"externalTrackingId: ${call?.getExternalTrackingId()}, "+
"isMeeting: ${webexViewModel.isMeeting()}, " +
"isPmr: ${webexViewModel.isPmr()}, " +
"isSelfCreator: ${webexViewModel.isSelfCreator()}, " +
"isSpaceMeeting: ${webexViewModel.isSpaceMeeting()}, "+
"isScheduledMeeting: ${webexViewModel.isScheduledMeeting()}")

onCallConnected(call?.getCallId().orEmpty(), call?.isCUCMCall() ?: false, call?.isWebexCallingOrWebexForBroadworks() ?: false)
Expand Down Expand Up @@ -1403,9 +1404,8 @@ class CallControlsFragment : Fragment(), OnClickListener, CallObserverInterface
val acceptedCall = bundle.getBoolean(Constants.Action.WEBEX_CALL_ACCEPT_ACTION)
if(!acceptedCall) {
incomingLayoutState(false)
ringerManager.startRinger(Call.RingerType.Incoming)
}

ringerManager.startRinger(Call.RingerType.Incoming)
val _call = CallObjectStorage.getCallObject(incomingCallId)
_call?.let { call ->
webexViewModel.setCallObserver(call)
Expand Down Expand Up @@ -2045,6 +2045,8 @@ class CallControlsFragment : Fragment(), OnClickListener, CallObserverInterface

webexViewModel.isLocalVideoMuted = isSelfVideoMuted

onVideoStreamingChanged(callId)

if (webexViewModel.isLocalVideoMuted) {
localVideoViewState(true)
videoButtonState(true)
Expand Down Expand Up @@ -2400,7 +2402,7 @@ class CallControlsFragment : Fragment(), OnClickListener, CallObserverInterface
try {
if (breakout == null) {
val callInfo = webexViewModel.getCall(callId)
Log.d(TAG, "CallControlsFragment showCallHeader callerId: $callId, callInfo title: ${callInfo?.getTitle()}")
Log.d(TAG, "CallControlsFragment showCallHeader callerId: $callId")
binding.tvName.text = callInfo?.getTitle()
binding.callingHeader.text = getString(R.string.onCall)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import android.util.Log
import androidx.core.app.NotificationCompat
import com.ciscowebex.androidsdk.CompletionHandler
import com.ciscowebex.androidsdk.internal.ResultImpl
import com.ciscowebex.androidsdk.kitchensink.BuildConfig
import com.ciscowebex.androidsdk.kitchensink.WebexRepository
import com.ciscowebex.androidsdk.kitchensink.KitchenSinkApp
import com.ciscowebex.androidsdk.kitchensink.R
Expand Down Expand Up @@ -118,7 +119,23 @@ class KitchenSinkFCMService : FirebaseMessagingService() {

private fun processFCMMessage(remoteMessage: RemoteMessage) {
GlobalScope.launch(Dispatchers.Main) {
val fcmDataPayload = repository.webex.phone.buildNotificationPayload(remoteMessage.data, remoteMessage.messageId.orEmpty())
var payload = remoteMessage.data

var fcmDataPayload = "none"
for ((key, value) in payload) {
Log.i(TAG, "$key = $value")
// If its from webhook unpack and use. else regular flow
if(key == "pinpoint.jsonBody") {
val jsonValue = JSONObject(value)
Log.i(TAG, "" + jsonValue["webhookTelephonyPush"])
fcmDataPayload = (jsonValue["webhookTelephonyPush"] as String)
break
}
}

if(fcmDataPayload == "none"){
fcmDataPayload = repository.webex.phone.buildNotificationPayload(remoteMessage.data, remoteMessage.messageId.orEmpty())
}
val authorised = repository.webex.authenticator?.isAuthorized()
if (authorised == true) {
processPushMessageInternal(fcmDataPayload) {
Expand Down Expand Up @@ -391,7 +408,13 @@ class KitchenSinkFCMService : FirebaseMessagingService() {
}
val mId = task.result
mId?.let {
repository.webex.phone.setPushTokens(KitchenSinkApp.applicationContext().packageName, it, token)
if(BuildConfig.WEBHOOK_URL.isEmpty()) {
repository.webex.phone.setPushTokens(
KitchenSinkApp.applicationContext().packageName,
it,
token
)
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ package com.ciscowebex.androidsdk.kitchensink.firebase

import android.os.AsyncTask
import android.util.Log
import com.ciscowebex.androidsdk.kitchensink.BuildConfig
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.HttpURLConnection
import java.net.URL

class RegisterTokenService : AsyncTask<String, String, String>(){
val tag = "RegisterTokenService"
private val tokenServiceUrl = "https://serene-meadow-01887.herokuapp.com/register"
private val tokenServiceUrl:String = BuildConfig.WEBHOOK_URL

override fun doInBackground(vararg params: String?): String {
var result = ""
try {
result = registerToken(params[0].orEmpty())
}catch (e: Exception){
Log.d(tag, "Error in register token", e)
if(!tokenServiceUrl.isEmpty()) {
try {
result = registerToken(params[0].orEmpty())
} catch (e: Exception) {
Log.d(tag, "Error in register token", e)
}
}
return result
}
Expand All @@ -37,12 +40,11 @@ class RegisterTokenService : AsyncTask<String, String, String>(){
val con: HttpURLConnection = url.openConnection() as HttpURLConnection
con.requestMethod = "POST"

con.setRequestProperty("Content-Type", "application/json; utf-8")
con.setRequestProperty("Content-Type", "application/json")
con.setRequestProperty("Accept", "application/json")

con.doOutput = true

Log.d(tag, "request body: $jsonInputString")
con.outputStream.use { os ->
val input = jsonInputString.toByteArray(charset("utf-8"))
os.write(input, 0, input.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class MessageComposerViewModel(private val composerRepo: MessageComposerReposito

fun postToPerson(id: String, message: Message.Text, files: ArrayList<LocalFile>? = null) {
composerRepo.postToPerson(id, message, files).observeOn(AndroidSchedulers.mainThread()).subscribe({ result ->
Log.d(tag, "postToPersonID result: $result")
_postMessages.postValue(result)
}, { error -> _postMessageError.postValue(error.message) }).autoDispose()
}
Expand Down
Binary file added images/fcm_sequence_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wxc_incoming_call.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72413ec

Please sign in to comment.