Redirect to view in other image folders using ImagePicker plugin in android (Ionic 3) - ionic-framework

I am using the image picker plugin in my Ionic app. I want able to pick images from other folders from the gallery in android device. For Ios it is possible but for android I am getting this view.
But I want user able to go to other folders and select images from it. Any help would be great.

I supose you are using cordova plugin File. If you want select others routes, u can use the diferents directories provided by File. EJ:
this.file.applicationStorageDirectory
this.file.applicationDirectory
this.file.documentsDirectory
You have the complete list here https://github.com/apache/cordova-plugin-file
If you need more help, say to me.
to use if With Filepicker use a constant to set options:
const options = {
title: 'Select Avatar',
customButtons: [{ name: 'fb', title: 'Choose Photo from Facebook' }],
storageOptions: {
skipBackup: true,
path: 'images',
},
};
and send it to the picker:
ImagePicker.showImagePicker(options, (response) => {

Related

Ionic Capacitor: How to restrict Gallery from Camera options?

for an app that I'm building, I'm using Capacitor's Camera plugin. When I click the button that launches the camera, it's asking me to first choose between Gallery and Camera.
I'd like to turn the "Pick from Gallery" feature off.
Is there any solution for this?
By default the Camera plugin prompts, but you can select Camera or Gallery by passing the source attribute
// The source to get the photo from. By default this prompts the user to select either the photo album or take a photo. Default: CameraSource.Prompt
source ?: CameraSource;
Full example:
const image = await Camera.getPhoto({
quality: 90,
resultType: CameraResultType.Uri,
source: CameraSource.Camera
});

SocialSharing plugin on Ionic 3, incorrect preview image

I am using the Social Sharing plugin from https://ionicframework.com/docs/v3/native/social-sharing/ within my Ionic 3 app.
Within my code I have:
import { SocialSharing } from '#ionic-native/social-sharing';
And then ..
this.socialSharing.share('Check out Fanslide - In Play Fantasy Football! ' + this.myShareLink, '', 'https://www.fanslide.com/assets/images/appicon-small.png', '');
I am specifying the URL to an image as the third parameter.
If I then open the app and activate the share then I see the attached. There is a thumbnail a "T" and a cursor. This isn't my image so I am not sure where this is coming from.
How can I make sure that the image URL I specify is shown as the thumbnail?
Thank you

How to do local notification in ionic 4 with capacitor that show icon and image in notification "not cordova local notification "

i use ionic 4 capacitor to show local notification which i found documentation on there website
but documentations are not complete
this is their link
ionic capacitor local notification documentation
It is working but i don't know how to show image and how to change the icon.
i tried a lot of thing.
Is there anyone who tested it and can help me?
this is my code already
LocalNotifications.schedule({
notifications: [
{
title: "aaaa",
body: "Body",
id: 1,
actionTypeId: 'OPEN_PRODUCT',
attachments: [
{ id: 'face', url: 'https://khanoo.com/wp-content/uploads/estate_images/house/77-1576179614/230174.jpg' ,options:{}}
],
schedule: {
every: "minute"
},
extra: null
}
]
});
From the code source, looks like they have some definition for smallIcon (but it's apparently only for Android)...
About the image - not sure what kind of image do you want to show...
From the definition, they have the LocalNotificationAttachment that can be used for iOS to show rich notifications.
It's something like this

Load Local HTML/JavaScript/CSS Inside NativeScript App

With a NativeScript iOS and Android app using Angular, how do I load, inside of a WebView, a locally stored html file that has JS and CSS references? I am able to display the WebView but I get the error that the file is not found because I do not know where to point the src from my component.
Currently I have the files inside src/assets and in there is the index.html
Is there a more appropriate place to store these files within the app? Is there a better way to display this than a WebView? How do I reference this file as the source of a WebView?
I will also be needing to know how to reference a file the app downloads. Where does iOS and Android store downloaded files from within the app? How do i reference these files from my WebView?
Thank you.
You have to use absolute path while importing local JS / CSS / Image into WebView. Here is a Playground sample. Unlike the given example if you want to load files those are packed with app, simply use app directory instead with right path to file.
I'm using path like:
src='~/assets/player.iframe.html'
And in the webpack.config.js I just added
new CopyWebpackPlugin([
{ from: { glob: "assets/**" } }, <= Added this row
{ from: { glob: "fonts/**" } },
{ from: { glob: "**/*.jpg" } },
...

Firefox add-on Action Button has no icon

I added this code to my Add-on SDK extension in the index.js:
var button = ActionButton({
id: "my-button",
label: "my button",
icon: {
"16": "./us16.png",
"32": "./us32.png"
},
onClick: firstClick
});
The Action Button gets added just fine and works, but there is no icon showing. I put the two icon files in the root folder of my add-on. Should I have put them elsewhere?
(Button documentation.)
Yes. Put your icons in data folder, whilst leaving the paths in the code as they are now.
I have same problem. And solution is add this code to packet.json
"permissions": {"private-browsing": true}
see here Firefox SDK Sample Add On Exported XPI Action Button Doesn't Show Up