Outlook add-in on owa mobile: body.getAsync do not get all the body message - outlook-addin

I write an outlook add-in in js and now I try to customize it to mobile version ( OWA app and browsers).
In OWA app read mode - If the message is bigger then 50,000 characters the getAsync return just part of the message and not all the message.
It returns something like the first 47,000 characters.
I don't find any reason for it because in rich client and Outlook web 365 I get the all message.
The code i used:
var item = Office.context.mailbox.item;
return new Promise(function (resolve, reject) {
item.body.getAsync(
typeOfGet,
{ asyncContext: "This is passed to the callback" },
function callback(resultbody) {
// the resultbody.value is the message but i get just part of it
}

Can you confirm whether you are using Outlook App or Mobile browser? If Outlook App, Android or iOS?

Related

Can I use Firebase's signinWithRedirect within the dialog API of a MS Powerpoint Add-In on Safari?

I'm developing authentication with firebase for a add-in for MS Powerpoint. In order to add authentication with Google I created a button which opens a dialog box:
`function openGoogleAuthDialog() {
Office.context.ui.displayDialogAsync(hostURLofDialogComponent,
{ width: 50, height: 50 }, (result) => {
if (result.status === Office.AsyncResultStatus.Succeeded) {
dialog = result.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, processMessage);
} else {
console.log("Unable to open dialog box");
}
});
}`
The dialog opens successfully. Within the Dialog component i have another button that should redirect to google as well as a useEffect that is supposed to send back the result of the authentication to the parent.
`export function AuthDialog() {
const authFirebase = getAuth(firebaseApp);
const handleAuth = () => {
const provider = new GoogleAuthProvider();
signInWithRedirect(authFirebase, provider);
};
useEffect(() => {
getRedirectResult(authFirebase).then((result) => {
Office.context.ui.messageParent(JSON.stringify(result));
});
}, []);
return <button onClick={handleAuth}>Authenticate With Google</button>;
}`
The problem is, that if I click on the button it will leave the page and it seems like it's gonna redirect but then stops and comes back to the dialog component without showing me the google sign-in interface.
I tried this functionality within google chrome and brave browser and it shows the Google Sign-In Interface as expected. As MS Office Plugins are using Safari under the hood, and the functionality was behaving in the same faulty way in the Safari browser, I can imagine it's a problem with Safari. Has anyone experienced a similar issue? Your help would be much appreciated!

React native send an automatic message without opening whatsapp

I'm trying to send a text message to a WhatsApp contact from a react-native apps , i found that i can do it through Linking
Linking.openURL('whatsapp://send?text=hello');
the above code opens whatsapp. I would like to send message without opening whatsapp
you can do it using Share.shareSingle from react-native-share package
const shareOptions = {
title: 'Share via',
message: 'some message',
url: 'some share url',
social: Share.Social.WHATSAPP,
whatsAppNumber: "9199999999", // country code + phone number
filename: 'test' , // only for base64 file in Android
};
Share.shareSingle(shareOptions)
.then((res) => { console.log(res) })
.catch((err) => { err && console.log(err); });
The shareSingle() method allows a user to share a premade message via
a single prechosen social medium. In other words, code specifies both
the message that will be sent and the social medium through which the
message will be sent. The user chooses only to whom the message is
sent. This shared message may contain text, one or more files, or
both.
Checkout - https://react-native-share.github.io/react-native-share/docs/share-single
also i've given working example to share multiple or single images using react-native-share as answer to a question about how to do it. might be useful.
Checkout Here

Outlook Web App add in Dialog Api messageParent not working

I am developing a Outlook add in and was checking out the authentication flow (Microsoft login) for my app. I tried using the dialog api to achieve this but was not able to pass message from the dialog to the task pane after successful sign in.
index.js:
var fullUrl = 'https://localhost:3000/src/templates/auth.html'
Office.context.ui.displayDialogAsync(fullUrl,
{height: 40, width: 40}, function (result) {
console.log("Dialog has initialized. Wiring up events");
_dlg = result.value;
console.log(result.status);
_dlg.addEventHandler(Office.EventType.DialogMessageReceived, function(responseMessage){ console.log(responseMessage);});
});
Dialog box:
Office.initialize = function (reason) {
$(document).ready(function () {
Office.context.ui.messageParent("Message 1");
}
}
In the dialog console I get this,
outlook-web-16.01.debug.js:4587 Failed to execute 'postMessage' on
'DOMWindow': The target origin provided ('https://outlook.live.com')
does not match the recipient window's origin
('https://localhost:3000').
Any idea what could be the problem?

twilio react native integration

I'm trying to create a react native app that allows the user to click a button and a call to their phone will be placed using the TWILIO API. I have it working from terminal by typing node make_call.js(name of file) but i want the user to be able to make the call when they want to by inputing their phone number and clicking a call button. Heres my code. the credentials are fake. Is this possible??
var accountSid = 'AC76d99966f35141f7c8585e31ed740480'
var authToken = '6470ce0905736f0f9da91456f088e97cc2'
var client = require('twilio')(accountSid, authToken);
client.calls.create({
url: 'https://demo.twilio.com/welcome/voice/',
to: '7781234564',
from: '6042322056',
}, function(err, call) {
if(err) {
console.log(err);
} else {
console.log(call.sid);
}
})
Twilio developer evangelist here.
You can actually build phone calling directly into your application using the Twilio Voice SDK.
There is already available to, built by the community, a React Native wrapper for the Twilio Voice SDK.
Let me know if that helps at all.

React Native: How to open a Bitcoin URL?

How do you open a Bitcoin URL in a react native app? I am using React Native Linking to detect if there are any apps on the phone that can open a Bitcoin URL formatted according to BIP21. I have 3 apps installed that should handle it:
1) Coinbase
2) Breadwallet
3) Blockchain.info wallet
But it's not opening. Here's the code:
async _openWallet() {
const coinURL = 'bitcoin:15bMc6sQTiQ5jSqoRX3JzatAbQqJaffqup';
try {
const supported = await Linking.canOpenURL(coinURL);
if (supported) {
Linking.openURL(coinURL);
} else {
console.log('Could not find a compatible wallet on this device.');
}
} catch (error) {
console.log(error);
}
}
supported keeps returning false, which causes "Could not find a compatible wallet..." to execute. The weird thing is if I click on a Bitcoin URL on any random website via the Chrome / Safari browser, I get a popup that asks me if I want to open the URL in one of the above apps. So only URLs on websites are opening, but not URLs from inside react native code.
Any ideas?
Looks like every URI scheme you want to use at runtime must be defined up-front in Info.plist. Found the answer here: React Native: Linking API not discovering Uber app