Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228529 articles
Browse latest View live

How to run Ionic 3 and Ionic 4 environments on same machine without conflicts on macOS

$
0
0

Hi @daveshirmancandc

Currently on my IMac I am using Ionic 3 on a mobile app we created.

On windows I recreate the mobile app using ionic 4 to have the latest framework.

Now I need to use IMac to upload and test the new version of my app with ionic 4…

What should i do? since i dont want to remove ionic 3… should i create a new user account on my I Mac?
or there is an easier way around it?

Thanks
J.


On Mac, Unable to install the oneSignal plugin on Ionic

$
0
0

I am working on an Ionic application which uses the oneSignal plugin. My project is developed under Windows and the plugin works very well. But when I recover my project on mac, the plugin refuses to install

  1. I get my project with the git commands

  2. I open the access rights to my project folder

  3. I added :

sudo npm i --unsafe-perm
sudo gem install cocoapods
pod setup
pod repo update
  1. finally when I add
sudo cordova platform add ios@latest

I get this warning :

"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.

Failed to install 'onesignal-cordova-plugin': undefined

Failed to restore plugin "onesignal-cordova-plugin" from config.xml. You might need to try adding it again. 
Error: /Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:439:in `help!':
 [!] You cannot run CocoaPods as root. (CLAide::Help)

If I try to uninstall and install oneSignal again I get this alert :

"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
Failed to install 'onesignal-cordova-plugin': undefined

CordovaError: Promise rejected with non-error: '/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:439:in `help!\': \u001b[31m[!] You cannot run CocoaPods as root.\u001b[39m (CLAide::Help)\n\n\u001b[4mUsage:\u001b[24m\n\n    $ \u001b[32mpod\u001b[39m \u001b[32mCOMMAND\u001b[39m\n\n      CocoaPods, the Cocoa library package manager.\n\n\u001b[4mCommands:\u001b[24m\n\n    \u001b[32m+ cache\u001b[39m      Manipulate the CocoaPods cache\n    \u001b[32m+ env\u001b[39m        Display pod environment\n    \u001b[32m+ init\u001b[39m       Generate a Podfile for the current directory\n    \u001b[32m+ install\u001b[39m    Install project dependencies according to versions from a\n                 Podfile.lock\n    \u001b[32m+ ipc\u001b[39m        Inter-process communication\n    \u001b[32m+ lib\u001b[39m        Develop pods\n    \u001b[32m+ list\u001b[39m       List pods\n    \u001b[32m+ outdated\u001b[39m   Show outdated project dependencies\n    \u001b[32m+ repo\u001b[39m       Manage spec-repositories\n    \u001b[32m+ setup\u001b[39m      Setup the CocoaPods environment\n    \u001b[32m+ spec\u001b[39m       Manage pod specs\n    \u001b[32m+ update\u001b[39m     Update outdated project dependencies and create new Podfile.lock\n\n\u001b[4mOptions:\u001b[24m\n\n    \u001b[34m--silent\u001b[39m     Show nothing\n    \u001b[34m--version\u001b[39m    Show the version of the tool\n    \u001b[34m--verbose\u001b[39m    Show more debugging information\n    \u001b[34m--no-ansi\u001b[39m    Show output without ANSI codes\n    \u001b[34m--help\u001b[39m       Show help banner of specified command\n\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:47:in `run\'\n\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>\'\n\tfrom /usr/local/bin/pod:22:in `load\'\n\tfrom /usr/local/bin/pod:22:in `<main>\'\n'

I saw that it was advisable to install the oneSignal plugin without sudo but when I do this I get this error message:

Error: EACCES: permission denied, open '/Users/macos/Library/Preferences/insight-nodejs/insight-cordova.json.1999532748'

Cordova -v : 9.0.0 (cordova-lib@9.0.1) - ionic -v : 5.2.3

Do you have any idea of the problem ?

Ionic native file opener 2 error class not found

$
0
0

Hi,

I have the same problem always… if i running de app with ionic cordova build android, or android --prod or android --prod --release

Somebody can help me? im using old ionic version because the app its very old

cli packages: (---)
    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:
    cordova (Cordova CLI) : 8.0.0

local packages:
    @ionic/app-scripts : 3.2.1
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:
    Android SDK Tools : 26.1.1
    Node              : v8.11.2
    npm               : 6.4.1 
    OS                : Windows 7

Environment Variables:
    ANDROID_HOME : c:\android

Misc:
    backend : pro

Thanks in advanced

Push get Token

Ionic 3 | cordova-plugin-screenrecord works but no mp4 file

$
0
0

Dear all,

I’m facing small problem with using cordova-plugin-screenrecord

My code start record & finish record but no mp4 file. Please check my code bellow:

declare let ScreenRecord: any;
record(){
    try{
      ScreenRecord.startRecord(
        {isAudio: true},
        "file:///storage/emulated/0/Android/data/io.ionic.starter/files/test.mp4",
        (success)=> {
          this.recording=true;
          alert(success);
        }, (error)=>{
          alert(error);
        }
      );
    }catch{e=>{

    }}
  }
stop(){
    try{
      ScreenRecord.stopRecord(
        (success)=>{
          this.recording=false;
          alert(success + " : " + "file:///storage/emulated/0/Android/data/io.ionic.starter/files/test.mp4");
        },
        (error)=>{
          alert(error);
        }
      );
    }catch{e=>{

    }}
  }

Storage- Ionic2 RC

$
0
0

it is really easy just :
add ‘localstorage’ to driverOrder
like this::
** IonicStorageModule.forRoot({**
** name: “Database”,**
** driverOrder: [“indexeddb”, “localstorage”]**
** }),**

How to obfuscate cordova plugin java code

$
0
0

I have been working on ionic 3 mobile applications. I obfuscate typescript codes using ionic-voricles-obfuscate plugin (https://www.npmjs.com/package/ionic-voricles-obfuscate)

While reverse-engineering the APK using Apktool , Android library classes in cordova plugins are not obfuscated. The Application security team asking to Obfuscate the Java / Android packages using proguard in order to prevent the application from run time code manipulation , due to this my application is rejected by Appsec team. I have referred lots of articles , all are very brief introduction about proguard tool , I am very confused whether I am approaching the right method for obfuscating my Ionic mobile application. I am new to Mobile application development and don’t have hands of experience in code obfuscation. Kind help needed from Ionic forum for a quick fix. I appreciate your quick response , Thanks a ton in advance :slight_smile:

Is it possible to save picture to firebase storage with original quality?

$
0
0

Hello
I get image using image picker plugin, then I saved it to firebase storage.
but when I save image of 1.8Mb but stored image is about 700kb…
is it possible to keep file quality?

code to get image is

getPhoto(){
    console.log("get photo come ");
    
  const options = {
  maximumImagesCount: 100,
  
  width: 1000,
  height: 1000,
  quality:100,
  outputType:1
  
  // quality of resized image, defaults to 100
};
setTimeout(()=>{
  this.ip.getPictures(options).then((results) => {
    
    console.log(results);
    for (var i = 0; i < results.length; i++) {
        console.log('Image URI: ' + results[i]);
       
    }
    this.viewCtrl.dismiss({"flag":"multi","data":results});
  }, (err) => { console.log(err)});
 
},1000)
  
  }

code to save to firebase storage is

console.log("retrieved image is : ");
      if(imagedata!=undefined){
        console.log(imagedata);
        if(imagedata.flag=="multi"){
          console.log(imagedata.data);
          this.totalnum=imagedata.data.length;
        if(imagedata.data!=undefined){
          for(var i=0; i<imagedata.data.length; i++){
            console.log("uploading........"+i);
            this.picdata=imagedata.data[i];
            this.uploadImageToFirebase(imagedata.data[i],i);
          }
         
        }
      }
    
    }
uploadImageToFirebase(image,index){
    console.log("upload iamge to firebase");
    console.log(image);
    this.uploadImage(image,index)
  }
uploadImage(imageURI,index){
      let storageRef = firebase.storage().ref();
      var result="design"+(index+1);

      console.log(imageURI);
      imageURI=  "data:image/jpeg;base64," + imageURI;

      console.log("sssssssssss : "+result);
      console.log(imageURI);
          var a = this.mypicref.child(this.key).child(result)
      this.encodeImageUri(imageURI, (image64)=>{
        console.log("image64 converted done");

       
        a.putString(image64, 'data_url',{contentType:'image/jpeg'})
        .then(snapshot => {
          this.mypicref.child(this.key).child(result).getDownloadURL().then((url)=>{
         ....
        ....

On Mac, Unable to install the oneSignal plugin on Ionic

Android App crash on Android Q

$
0
0

I am use secure storage on my app but i am try to open app on android Q my app crash
I am debugging my app, display following error
'no activity found to handle intent act=com.android.credentials.unlock ’

Once downloaded, images not display in android gallery? in ionic 3..stuck from last two month... please help

$
0
0

you can direct save img in android gallery using file.externalrootdirectory

Once downloaded, images not display in android gallery? in ionic 3..stuck from last two month... please help

$
0
0

Thanks for your replay but sir, file.externalrootdirectory i have used this also but not shown in mobile gallery

Once downloaded, images not display in android gallery? in ionic 3..stuck from last two month... please help

$
0
0

use file.externalrootdirectory+"/Download/"+fileNameWithExt

Input File Picker not working

$
0
0

I using the ion-input file, but it only work on desktop browser but on ios safari, nothing happen after i click it.

<ion-input id="fileInput" type="file" accept="image/*;capture=camera" (change)="changeListener($event)" #fileInput></ion-input>

since it not working, I try using button to trigger the file input, but nothing happen again on both desktop and ios safari

Once downloaded, images not display in android gallery? in ionic 3..stuck from last two month... please help

$
0
0

file.externalrootdirectory+"/Download/" …yes i have used this link/download folder as wel but image is downloading successfully but not showing in gallery, actully i also used new local link to create new folder like i have given in my code i.e. “this.file2.externalRootDirectory +’/Foldername/Media/images/”


Ionic app just with outside page embebed

$
0
0

Hello, I wanted to ask if you can make an app with ionic that is only an outside page. That is, only as a container for it, and be able to publish it in the different markets.
If so, could device sensors be used such as geolocation? Thank you

Input File Picker not working

$
0
0

use chrome browser on mac for test

Cannot find module '@ionic-native/splash-screen/ngx'

$
0
0

check in your ng_module/@ionic-native/splash-screen/ …is ngx folder available if not then import like
import { SplashScreen } from ‘@ionic-native/splash-screen’
just remove ‘/ngx’ if ngx folder is available then uninstall and install it again

npm uninstall @ionic-native/splash-screen
npm install --save @ionic-native/splash-screen

Call Number - not working

$
0
0
call() {
    let tel_number = '9870684933'
    window.open(`tel:${tel_number}`, '_system')
  }

This works ! thanks a lot man :slight_smile:

Ionic 4 Call Number Not Working

$
0
0

I had similar problems using the “Call Number” plugin on my MI phone.

Use the in app browser plugin, as suggested by Judgewest2000.

This works for me:-

call() {
    let tel_number = '9870684933'
    window.open(`tel:${tel_number}`, '_system')
  }
Viewing all 228529 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>