This repository has been archived by the owner on Mar 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Android API
wkh237 edited this page Sep 29, 2016
·
6 revisions
0.9.0
When sending an ACTION_VIEW
intent with given file path and MIME type, system will try to open an App to handle the file. For example, open Gallery app to view an image, or install APK.
Path of the file to be opened.
Basically system will open an app according to this MIME type.
For example, download and install an APK programatically
const android = RNFetchBlob.android
RNFetchBlob.config({
addAndroidDownloads : {
useDownloadManager : true,
title : 'awesome.apk',
description : 'An APK that will be installed',
mime : 'application/vnd.android.package-archive',
mediaScannable : true,
notification : true,
}
})
.fetch('GET', `http://www.example.com/awesome.apk`)
.then((res) => {
android.actionViewIntent(res.path(), 'application/vnd.android.package-archive')
})
Or show an image in image viewer
android.actionViewIntent(PATH_OF_IMG, 'image/png')