I want to open the Qliksense mobile app from another mobile application - react-native

I have developed a mobile application in react-native and on click of a icon I want to open the Qliksense app which is installed in mobile

Use Linking and the desired app url scheme:
import Linking:
import {Linking} from 'react-native';
Then on your function/action you would like to open the other app:
const canOpenUrl = await Linking.canOpenURL(url);
if (canOcanOpenUrl) {
Linking.openURL(url);
}
See more in the docs

Related

Leaflet: How To Open a Place In Google Map / Waze Native App and Use It To Navigate?

I am using Ionic React / React Native to develop a mobile app. I want to use Leaflet to display the static map and markers. If the user click the markers, I want to open the coordinate in Google Map / Waze / any native map application then use that native app to navigate the user into the marker.
Is there a way to open the marked place into native map apps?
Google Map provides cross-platform deep linking universal URLs. If the native Google Map app is installed. It will open with that app, otherwise, use the default web browser installed on user's device.
You can use React Native Linking API to dynamically link to a specific location.
import { Linking, Alert } from "react-native";
async function openWithGoogleMap() {
/** Google Map API offers different URL to deep link to various locatioon and map ressources.
* Check their docs - https://developers.google.com/maps/documentation/urls/get-started
*/
const url =
"https://www.google.com/maps/search/?api=1&query=47.5951518%2C-122.3316393";
const supported = await Linking.canOpenURL(url);
if (supported) {
// Opening the link with some app, if the URL scheme is "http" the web link should be opened
// by some browser in the mobile
await Linking.openURL(url);
} else {
Alert.alert(`Don't know how to open this URL: ${url}`);
}
}

React Native app seems not being able to communicate with API

I have just generated a release APK of my React Native app and installed it in my device but it seems not being able to communicate with my API. If I run it through CLI using [react-native run-android] everything works fine but when it comes to the generated APK I can't even authenticate in the app.
I don't know if it has something to do with Secure Sockets Layer or even cors. I'll be pleased if you guys could help me out with it.
That's my app config:
import express from 'express';
import cors from 'cors';
import routes from './routes';
import './database';
class App {
constructor() {
this.server = express();
this.middlewares();
this.routes();
}
middlewares() {
this.server.use(cors());
this.server.use(express.json());
}
routes() {
this.server.use(routes);
}
}
export default new App().server;
Context Information:
APK installed in Galaxy S10 (android 10)
It could be better if you provided more information about your test environment (emulator) and the device you use for testing generated APK.
however, I guess it's a network security issue in new android versions, so take a look at this answer.

How to open other mobile apps on press in React Native?

I am looking for an easy way to open apps, Facebook and Instagram specifically, on a button press from my React Native app. It should also check if the app is installed on the device first, and open the app store if it isn't. It needs to work on both iOS and Android. I am a beginner so if you can post an example it would help.
You can use Linking module of react-native to open other mobile apps.
import { Linking } from "react-native";
const APP_ID = //ID of app need to open in play store
const appDeepLinkURL = //Most of the mobile app provide it
Linking.openURL(appDeepLinkURL).catch(err => {
Linking.openURL(
`market://details?id=${APP_ID}`
).catch(err => Linking.openURL(
`http://play.google.com/store/apps/details?id=${APP_ID}`
).catch(err => console.error("An error occurred", err)););
});
Similarly, you can do for the iOS,
you can refer to the official doc here.
use react-native Linking Component
import {
TouchableOpacity,
Text,
Linking,
} from 'react-native';
<TouchableOpacity onPress={() => { Linking.openURL('sms:' + {contactNumber}
+ '?body=Hi'); }}>
<Text> Open Message App </Text>
</TouchableOpacity>

react native share in a single application

In my react-native app, I want to share a text message with a specific application, e.g whatsapp or texting application without having to first land on the dialog with all the social applications.
For instance if I press the share button and whatsapp is called directly.
I tried using react-native-share but it seems to not be working anymore.
You can use Linking, which gives you a general interface to interact with both incoming and outgoing app links.
For example:
import React, { Component } from 'react';
import { Linking, Button } from 'react-native';
export class App extends Component {
render() {
return <Button
onPress={() => {
let url = 'whatsapp://send?text=Hola Mundo';
Linking.openURL(url).then((data) => {
console.log('open whatsapp')
}).catch(() => {
console.log('App not installed')
});
}}
title="Whatsapp"
color="#4FBE3C"/>;
}
}
For Android, the React Native Share module uses the default ACTION_SEND android intent:
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
In order to have a different behavior, you need either write our own RN plugin that would talk to the app you want it to (if such feature is available) or find a similar plugin on npm.
I assume your plugin should do something like this:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
sendIntent.setPackage("com.whatsapp");

React Native Open settings through Linking.openURL in IOS

I want to open ios setting app from my app. the settings destination is [ settings => notification => myapp ]. to turn on & turn off push notification.
There are some documents about how to link to settings, but I don't know how to open deep link. (notification => myapp).
How can I do this?
You can deep-link referencing the settings's index like so:
Linking.openURL('app-settings:')
Above method only for IOS
Since React Native 0.60 to open App settings use:
import { Linking } from 'react-native';
Linking.openSettings();
Open the app’s custom settings, if it has any.
Works for Android and iOS
Use Linking.openURL. For example, below is how to check and open Health app on iOS
import { Linking } from 'react-native'
async goToSettings() {
const healthAppUrl = 'x-apple-health://'
const canOpenHealthApp = await Linking.canOpenURL(healthAppUrl)
if (canOpenHealthApp) {
Linking.openURL(healthAppUrl)
} else {
Linking.openURL('app-settings:')
}
}
for iOS 14, this is how i open location service settings
Linking.openURL('App-Prefs:Privacy&path=LOCATION')
tested in react native 0.63.4
To access specific settings screens, try this:
Linking.openURL("App-Prefs:root=WIFI");
Linking to app-settings only opens the settings for the
Reference: iOS Launching Settings -> Restrictions URL Scheme (note that prefs changed to App-Prefs in iOS 6)
Try this one for Open Specific System URL - Linking.openURL('App-Prefs:{3}')
try this
Linking.openURL('app-settings://notification/myapp')