<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="thestarrchefdev.page.link" android:scheme="https" /> <data android:host="thestarrchef.page.link" android:scheme="https" /> <data android:host="www.thestarrchef.com" android:scheme="http" /> </intent-filter>
try {
FirebaseDynamicLinks.getInstance()
.getDynamicLink(intent)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
val pendingDynamicLinkData = task.result
when {
pendingDynamicLinkData != null -> {
checkAppData(pendingDynamicLinkData.link?.query)
}
intent.data != null -> {
val data = intent.dataString?.split("?")
if (data?.size ?: 0 >= 2) {
checkAppData(data = data?.get(1) ?: "")
} else {
checkAppData("")
}
}
else -> {
saveReferral(AppConfig.ORGANIC_INSTALL_QUERY)
checkAppData(null)
}
}
} else {
checkAppData(null)
}
}
} catch (ex: Exception) {
ex.printStackTrace()
}
fun sendContent(
context: Context, postId: String?, title: String?,
packageName: String = "",
businessPost: Boolean = false
) {
val link = "${AppConfig.BASE_URL}$postId"
FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse(link))
.setDomainUriPrefix(BuildConfig.DynamicLink)
.setAndroidParameters(
DynamicLink.AndroidParameters.Builder(BuildConfig.APPLICATION_ID)
.setMinimumVersion(AppConfig.MIN_VERSION_FOR_INVITE)
.build()
)
.setIosParameters(
DynamicLink.IosParameters.Builder(BuildConfig.iOS_app_id)
.setAppStoreId(BuildConfig.iOS_store_id)
.setMinimumVersion(BuildConfig.iOS_min_version)
.build()
)
.buildShortDynamicLink()
.addOnSuccessListener { shortDynamicLink ->
val shareLink = shortDynamicLink.shortLink
val msg =
"Hey, Check out this amazing ${if (businessPost) "content" else "recipe"} ($title) on The Starrchef App. Download app now!!\n\n$shareLink"
shareText(context, String.format(msg, shareLink.toString()), packageName)
}.addOnFailureListener { e ->
shareText(
context,
"Hey, Check out this amazing ${if (businessPost) "content" else "recipe"} ($title) on The Starrchef App. Download app now!!\n\n${AppConfig.APP_URL}"
)
}
}
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
We are a team of artists. We provide professional services in the field of Mobile Applications, Web Applications and everything related to IT services. Turning to us for help once – you can no longer refuse.
© 2019 – 2022 | Made with ❤️ by App Ringer
Recent Comments