webview show up with another window in facebook messenger - facebook-messenger

I've tried to embed my website inside Facebook messenger by that documentation. Unfortunately, my website is popup with new window instead of inside embedded Facebook messenger.
"buttons":[
{
"type":"web_url",
"url":"https://petersfancyapparel.com/criteria_selector",
"title":"Select Criteria",
"webview_height_ratio": "full",
"messenger_extensions": true,
"fallback_url": "https://petersfancyapparel.com/fallback"
}
]
Please let me know what I've missed to put something in messenger configuration or something else? Thanks.

You don't have to specify your webview_height_ratio if you are using it that way.
From messenger docs :
Height of the Webview. Valid values: compact, tall, full. N, default
is full.
Try webview_height_ratio = "compact", instead of "webview_height_ratio": "full".

Related

how to disable text zoom effect on phone settings -ReactJS (web)

If the user has enlarged the font in the phone settings, how can I deactivate this setting?
I know one way for React Native. I need a web code like this:
//Here is React-Native example
if (Text.defaultProps) {
Text.defaultProps.allowFontScaling = false
} else {
Text.defaultProps = {}
Text.defaultProps.allowFontScaling = false
}
i couldn't find anything when I searched for a draft similar to this.
any idea?
thanks for your time.

Onesignal Webpush Notification : This site has been updated in the background

I have some concerns & questions about web push notifications using onesignal, because sometimes the notification show "this site has been updated in the background".
First what caused the notif shown like that, is that from settings device phone or from my code?
Second how to fix the message content like that?
i implement like this in head.js
if (navigator.serviceWorker) {
navigator.serviceWorker.register(`https://test.com/OneSignalSDKWorker.js?appId=test123`).then(function (registration) {
console.log(registration);
});
}
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js"></script>
is i call double sdk caused that?

How to open mail app inbox directly in react native?

Using Linking.openURL('mailto:') with expo-linking opens the mail app with a 'compose mail' screen, how can i open the mail app directly on the inbox tab ?
Inspired by this stack overflow post, you can use the message:// url scheme to achieve this on iOS. If no content is provided, it defaults to the email inbox on iOS.
For android, things are a little trickier. You'll need expo-intent-launcher and a few extra params to complete the hand-off. A complete solution may look something like this:
import { startActivityAsync, ActivityAction } from 'expo-intent-launcher';
[...]
if (Platform.OS === "android") {
const activityAction = "android.intent.action.MAIN";
const intentParams: IntentLauncher.IntentLauncherParams = {
category: "android.intent.category.APP_EMAIL",
};
IntentLauncher.startActivityAsync(activityAction, intentParams);
}
else if (Platform.OS === "ios") {
Linking.openURL('message://');
}
Be sure to test on real devices if possible since the iPhone simulator doesn't have a mail client installed.
List of URL schemes on wikipedia
Update: If you don't mind an extra dependency, take a look at react-native-email-link which has the added benefit of allowing users to select from any installed email client. Neat!

React Google Analytics - Events sending but not showing up

I'm using react-ga for Google Analytics:
import ReactGA from "react-ga";
ReactGA.initialize("UA-XXXXXXXXX-X", { debug: true });
ReactGA.pageview("/example");
ReactGA.event({
category: "Test",
action: "Click",
label: "Example"
});
This results in the following output:
Which makes me think that everything worked, but Google Analytics doesn't show the event on my dashboard. I also tried the following:
ReactGA.ga("send", "event", "Test", "Click", "Example");
Which gave the same output, but with nothing showing up on my GA dashboard. I've waited over half an hour and my GA dashboard still doesn't show the data. Is there something I'm doing wrong?
Note: The pageview does go through and shows up on my GA dashboard just fine.
instead of ReactGA.pageview("/example");
Try Using
ReactGA.pageview(window.location.pathname);
I am assertive it will work.
and have look at the documentation of ReactGa
https://www.npmjs.com/package/react-ga
Scroll Down to ReactGA.event(args)
There must be an issue with your args
Looks like I was just impatient. It took a while but the events did eventually show up on my GA dashboard.

Open URL in IBM Watson conversation

I am using a Blumix free account to develop a chat-bot using watson conversation.
How do I add a clickable URL in the response, or automatically call a URL in browser?
I have edited the "advanced response" using the suggestions as described on this page but could not get it work.
How can I achieve that?
I don't know if I understood your question correctly, but.. if you wants add some url inside flows Conversation Service (IBM Watson), try it:
1º: Add the url with tag <a target> and href= your URL inside flows. See the example:
JSON:
"output": {
"text": "This is a link <a target=\"_blank\" href= \"https://www.choosemyplate.gov\">Food and nutrition Guide</a>.\n<br/><br/>Talk to you later, bye for now!"
},
2º See that it did not work inside the Conversation, because it will be your browser that will render the html.
3º If you open with your browser, it works, see:
See that the link is showing up, and this will work for other things in html, like button, for example...
But if you can: based on user input should access a url:
This is done by using two features: Context.request skip_user_input
A request is a special context variable that has args, name and result. It is used to tell the calling app that it should do some action based on this variable.
Setting skip_user_input is optional. In many cases, you might want to execute some business logic in your application and then provide its results via result. Setting skip_user_input to true, will tell Watson Conversation to not wait for input from the user. Thus, your condition on the next node should be based on the content inside result.
{
"output": {},
"context": {
"request": {
"args": {
"url_to_invoke": "your_url"
},
"name": "Call_A_URL",
"result": "context.response"
},
"skip_user_input": true
}
}
Reference: IBM Professional #Dudi: here.

Resources