webex / spark-ios-sdk

DEPRECATE. Check our newer iOS SDK
https://github.com/webex/webex-ios-sdk
Other
35 stars 15 forks source link

Notifications for calls in background #41

Closed buh closed 2 years ago

buh commented 6 years ago

We have a case, where our server received an event of incoming call via a registered webhook. Then it sends a silent push notification to our iOS app about that call. Our app receives that push notification in the background state and our app should start a calling session. To do that, we should send a request to Spark SDK to make a web socket connection, that is required to start a calling session.

Specifically for our CallKit integration the web socket needs to be opened before the application becomes foregrounded, since the call could be answered from the locked screen. In that case the user needs to receive audio before the application is visible.

The second reason is that we only report a call to the user based on the events from the web socket connection. e.g. report the call to the CallKit framework, because that is the only way to be certain the call exists. If we would just rely on the push notification it could lead to notifying user of incoming calls, even though they might no longer exists.

We already did the similar PR in the previous version of Spark SDK and it was merged to master. https://github.com/ciscospark/spark-ios-sdk/pull/13

In the new version of Spark SDK that functionality was missed and we created this PR with the similar solution.

kliu commented 6 years ago

We are working on it to find a better way to implement the requirement in next release.

paintmonkey commented 6 years ago

@kliu Is there any documentation available how this is implemented in the next release, so that we can prepare our app? E.g. do we need to notify the SparkSDK in any way to re-open the web socket whenever the app process is launched in the background, or does this happen automatically in the next release?