Skip to content

Instantly share code, notes, and snippets.

@tateisu
Created February 16, 2023 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tateisu/8ecb91ec4af6722c1420348fa406b427 to your computer and use it in GitHub Desktop.
Save tateisu/8ecb91ec4af6722c1420348fa406b427 to your computer and use it in GitHub Desktop.
// in manifest
<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="post"
android:scheme="web+activitypub" />
</intent-filter>
// in uri handling code
if( uri.scheme == "web+activitypub" && uri.authority == "post"){
val postUri = uri.pathSegments?.elementAtOrNull(0)
log.i("postUri=$postUri")
if(!postUri.isNullOrEmpty()){
conversationOtherInstance(
pos = defaultInsertPosition,
urlArg = postUri,
statusIdOriginal = null,
hostAccess = null,
statusIdAccess = null,
isReference =false,
)
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment