Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

The changelog for `Superwall`. Also see the [releases](https://github.com/superwall/Superwall-Android/releases) on GitHub.

## 2.6.7

### Fixes
- Fix handling of deep links when paywall is detached
C
## 2.6.6

## Enhancements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.superwall.sdk.paywall.view

import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
Expand Down Expand Up @@ -991,11 +992,24 @@ class PaywallView(
}

override fun openDeepLink(url: String) {
var uri = url.toUri()
val uri = url.toUri()
eventDidOccur(PaywallWebEvent.OpenedDeepLink(uri))
val context = encapsulatingActivity?.get()
val deepLinkIntent = Intent(Intent.ACTION_VIEW, uri)
context?.startActivity(deepLinkIntent)
val activityContext = encapsulatingActivity?.get()
val deepLinkIntent =
Intent(Intent.ACTION_VIEW, uri).apply {
if (activityContext == null) {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
}
try {
(activityContext ?: context).startActivity(deepLinkIntent)
} catch (e: ActivityNotFoundException) {
Logger.debug(
logLevel = LogLevel.warn,
scope = LogScope.paywallView,
message = "No activity found to handle deep link: $url",
)
}
}

//region GameController
Expand Down
Loading