react native share dynamic link - firebase

1.Everything work fine before share, I shared to Facebook Messenger and click the social content, the redirect link is not the link that firebase generated. The link has become the dynamic domain mixed with the title and description.
2.I tried to copy only the generated firebase link and paste to Facebook Messenger, social content loaded, then by clicking the content it call the dynamic link correctly and launch the app.
const link = new firebase.links.DynamicLink('https://example.com/parameter' , 'abc123.app.goo.gl')
.android.setPackageName('com.example.android')
.ios.setBundleId('com.example.android')
.social.setTitle("Social Title")
.social.setImageUrl("http://exmaple.com/super.png")
.social.setDescriptionText("Description");
firebase.links().createShortDynamicLink(link, 'SHORT')
.then((url) => {
Share.share({
message: "Message Title",
url: url,
title: "Title"
}, {
// Android only:
dialogTitle: 'Super Share'
})
// ...
});
How to share with correct dynamic link not just copy and paste, consider the user behavior.

Related

Manually constructing a Dynamic Link URL with OFL Parameter not working on Desktop Browser

I created dynamic link (React-Native App) which is working perfectly on Android & iOS devices but if open same link on desktop browser it say "Dynamic link not found/Invalid dynamic link". I have created custom dynamic link as well as using Firebase dynamic link
--- Using Firebase Link ---
await firebase.dynamicLinks().buildShortLink(
{
domainUriPrefix: `${prefix_url}`,
link: `${prefix_url}/${params}`,
android: {
packageName: `${package_name}`,
},
ios: {
bundleId: `${bundle_id}`,
appStoreId: 'xxxxxxxxxx',
},
otherPlatform: {
fallbackUrl: `${web_url}`,
},
},
firebase.dynamicLinks.ShortLinkType.UNGUESSABLE,
);
--- By Custom Link ---
longDynamicLink: `${prefix_url}/?link=${link_url}&apn=${package_name}&ibi=${bundle_id}&isi=xxxxxxxxx&ofl=${web_url}`,
suffix: {
option: 'UNGUESSABLE',
},
};
Issue -: Link on desktop browser not working (fallback url not working)
Dynamic link should redirect a website link on desktop

Deep Link doesn't open the app instead does a google search

I have been using Expo to develop a react-native app, The functionality I am currently trying to implement is to share a link with friends on platforms such as fb messenger/whatapp or even normal texts and when they click this link it will launch my app to a specific page using the parameters.
After extensive research online - I’ve come to a blocker, following expo’s documentation I defined a scheme for my app - when I press share everything works correctly a message is created and I’m able to share content but only as string.
I am using react-natives Share library to share to an app and I’m using Expo to provide me with the link.
Ideally my first goal is to get the app opening using the Expo Link before I explore further into adding more functionality to the link.
Share.share({
message: "Click Here to View More! " + Linking.makeUrl( ' ' , { postkey : "7a5d6w2x9d6s3a28d8d});
url: Linking.makeUrl( ' ' , { pkey : gkey });
title: 'This post is amazing',
})
.then((result) =>{
console.log(result)
if(result === 'dismissedAction'){
return
}
})
.catch((error) => console.log(error))
In the root of my app I have also defined the event handlers: App.js
_handleRedirect=(event)=> {
let {path,queryParams} = Linking.parse(event);
Alert.alert(`queryparams : ${event} path : ${path} `)
this.props.navigation.navigate("Post_Detail",{key:queryParams.postkey})
}
}
componentDidMount() {
let scheme = 'nxet'
Linking.getInitialURL()
.then(url => {
console.log("App.js getInitialURL Triggered")
// this.handleOpenURL({ url });
})
.catch(error => console.error(error));
Linking.addEventListener('url', ({url}) => this._handleRedirect(url));;
}
componentWillUnmount() {
Linking.removeEventListener('url', this.handleOpenURL);
}
When I share the link to Whatsapp, Facebook Messenger or even just messages or notes it appears as myapplink://, I try to enter this into the browser and instead of asking me to open my app - it does a google search.
Please note I am attempting to have this working on Android Device and facing this issue
Is there something I am doing incorrectly?
Any help is much appreciated. Thanks.
You can not open external links, means other than http, https on Android. But you can on iOS. In order to be able to open your expo links, you need proper anchor tags on android. You can create html mails and give it a try, you will see it is gonna work on Android as well.

No image or text appears when attemping to share to Twitter/Instagram using Xamarin.Essentials

I am using Xamarin.Essentials share feature but with lackluster success.
If i do a:
await Share.RequestAsync(new ShareTextRequest
{
Text = "Works",
Title = "Not working"
});
and open Twitter or Instagram or Whatsapp, i cannot see the Title, only the text getting filled.
If i do:
await Share.RequestAsync(new ShareFileRequest
{
Title = title,
File = new ShareFile(post.Image, "image/jpeg")
});
Then i cannot see either text or an image when attempting to share it to twitter or instagram. Is this a known bug or is it simply because these platforms doesn't support it?
"post.Image" has a valid .jpeg https url to it.

Open differents pages ionic 3 with push notifications

I need help,
I am trying to open different pages of my application in ionic3, I can do it for a specific page, but I want to differentiate the type of notification, example if the notification is of the message type, my message page is opened and if it is another type of notification will open a different page.
pushObject.on('notification').subscribe((notification: any) => {
this.nav.push(PushNotification); //here open specific page, but I need to open not only a specific page but several pages.
if (notification.additionalData.foreground) {
let youralert = this.alertCtrl.create({
title: 'New Push notification',
message: notification.message,
});
youralert.present();
}
});

Share activity on Google Plus using asp dotnet

How can i post an interactive post on google+ stream?
I am trying to post some custom data on google stream from asp.net web application.
This is the code iam using.
this is .aspx page:
Tell your friends
this is the script i am using:
var moment = {
"name": "sample",
"Description": "Hi sample post",
"Thumbnail": "logo",
"image": "http://prayati.com/Images/PrayatiLogo.jpg"
};
gapi.auth.init(signinCallback);
function signinCallback(authResult) {
if (authResult['access_token']) {
gapi.interactivepost.render('inter', options);
//gapi.interactivepost.render(moment, authResult['access_token'])
gapi.interactivepost.go(moment)
document.getElementById('myBtn').setAttribute('style', 'display: none');
} else if (authResult['error']) {
alert(authResult['error']);
}
}
var options = {
contenturl: 'https://plus.google.com/pages/',
contentdeeplinkid: '/pages',
clientid: '263087742134.apps.googleusercontent.com',
cookiepolicy: 'single_host_origin',
prefilltext: 'Create your Google+ Page too!',
calltoactionlabel: 'SHARE',
calltoactionurl: 'http://plus.google.com/pages/create',
calltoactiondeeplinkid: '/pages/create'
};
The first and probably most important problem is that you have a domain mismatch between your data-calltoactionurl and your data-contenturl. These must be the same domain, see the data-contenturl documentation.
I believe that is your major problem, there are other problems in your example too:
You appear to be confusing two different features: app activities (aka moments) and interactive posts. Also, it looks like you are trying to do authentication, the interactive post button is also a sign-in button, notice its data-callback parameter. You wouldn't need to do a separate call to gapi.auth.init()
The most simple approach is to use the HTML button and remove the calls to gapi.interactivepost.* unless you have a dynamic application that needs to insert buttons with great control.
You didn't post the code for your JavaScript API include, ensure that it is loading the API script as https://apis.google.com/js/client:plusone.js.
Here is a correct and simplified button:
<button class="g-interactivepost"
data-clientid="xxxxxxxxxx.apps.googleusercontent.com"
data-contenturl="http://localhost:52022/Jaswanth"
data-cookiepolicy="single_host_origin"
data-calltoactionlabel="INVITE"
data-calltoactionurl="http://localhost:52022/create"
data-prefilltext="Best site EVER!"
data-callback="signinCallback"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-scope="https://www.googleapis.com/auth/plus.login">
Tell your friends
</button>

Resources