Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70434 articles
Browse latest View live

Ionic native camera taking picture but not showing it .i want to take picture and show it on the same page

$
0
0

@ramashish wrote:

i am trying ion native camera api , thats takin picture as the camera shows up and i can click an image but tha image is not shoing up

i am using android oreo , ionic 3 and latest cordova and running app on a real device

<-- file home.html-->`
<ion-header>
  <ion-navbar>
    <ion-title>
      Ionic Blank
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
    <button ion-button round (click)="eventofClick()">Round Button</button>

  <p><img src="{{image}}" /> </p> 
{{image}}

</ion-content>
<--home.ts-- ------------------------------------------------------>

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Camera, CameraOptions } from '@ionic-native/camera';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
})
export class HomePage {
  image: any;

  constructor(public navCtrl: NavController, public camera: Camera) {
    console.log("constructor");

  }
eventofClick() {
    console.log("called");
    console.log('inside');
    const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}


 this.camera.getPicture(options).then((imageData) => {
   // imageData is either a base64 encoded string or a file URI
   // If it's base64 (DATA_URL):
   let base64Image = 'data:image/jpeg;base64,' + imageData;
  this.image = 'data:image/jpeg;base64,' + imageData;
  }, (err) => {
   // Handle error
  });
}
}

output -
broken%20image

console log

data:image/jpeg;base64,file:///storage/emulated/0/Android/data/com.catalyst.android.safra/cache/1549019043619.jpg
8.js:856 file:///storage/emulated/0/Android/data/com.catalyst.android.safra/cache/1549019043619.jpg
8.js:857 1
vendor.js:36245 WARNING: sanitizing unsafe URL value data:image/jpeg;base64,file:///storage/emulated/0/Android/data/com.catalyst.android.safra/cache/1549019043619.jpg (see http://g.co/ng/security#xss)
1549019043619.jpg:1 GET unsafe:data:image/jpeg;base64,file:///storage/emulated/0/Android/data/com.catalyst.android.safra/cache/1549019043619.jpg 404 (Not Found)

url stack question

Posts: 1

Participants: 1

Read full topic


Scrolling appears at the bottom of the ion-header

Base64 - Not allowed to load local resource

$
0
0

@marie_fashion wrote:

Hello! I am trying to convert a file to base64 using this plugin (https://ionicframework.com/docs/native/base64/). I am using the code as described

let filePath: string = 'file:///...';
this.base64.encodeFile(filePath).then((base64File: string) => {
  console.log(base64File);
}, (err) => {
  console.log(err);
});

When I import it with the /ngx extension I get the following error by running: ionic Cordova iOS build:

[12:38:36]  typescript: src/pages/contact/contact.ts, line: 9 
            Cannot find module '@ionic-native/base64/ngx'. 

       L8:  import { File } from '@ionic-native/file';
       L9:  import { Base64 } from '@ionic-native/base64/ngx';

[12:38:36]  ionic-app-script task: "build" 
[12:38:36]  Error: Failed to transpile program 

So I removed the /ngx and did:

import { Base64 } from '@ionic-native/base64';

But when I try to execute this function I get the following error:

Not allowed to load local resource: file:////var/mobile....

I also tried removing the file:/// parameter which ends up in cannot load http://localhost:8080/var/m. But his is also not like it should be used like mentioned here: stackoverflow.

my config is as follow:


Ionic:

   ionic (Ionic CLI)  : 4.7.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 9 other plugins)

System:

   ios-deploy : 1.9.4
   NodeJS     : v11.6.0 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

So mentioned to the plugin described here: https://github.com/hazemhagrass/phonegap-base64:

for Cordova >= 5.0.0
cordova plugin add com-badrit-base64

It should work like mentioned in the documentation? My plugin version is com-badrit-base64 0.2.0 “Base64”. Help is really appreciated. Also an alternative way in converting an audio file to base64. Thanks.

Posts: 1

Participants: 1

Read full topic

Alphabetically - scrollbar

Directory Creation in IOS

$
0
0

@SathishKanna wrote:

Hi All,

A little help is needed.We are working on ionic-native/file plugin and our will create one new folder for storing the media files when accessing camera hardware.The problem is like, We can able to access the folder in Android platform.In IOS platform folders can be created using tempDirectory, syncedDataDirectory, documentsDirectory and we are using documentsDirectory for creating folders.The problem is we can’t able to see the folder and its content in Albums.It is setting the folder to private.Any Solution would be appreciated.

Posts: 1

Participants: 1

Read full topic

Ionic 4 Start Theme (v1.0.0)

After selecting the value from popup, the pop up is still displayed on the UI

$
0
0

@kunalinfo wrote:

After selecting the value from popup, the pop up is still displayed on the UI. i used popoverController from the ionic , when i m selecting any value from pop-up … the value get selected but pop-up didn’t get closed it is there on the page only. but second time if select anything the popup get closed.

Posts: 1

Participants: 1

Read full topic

How to build a paid video app?

$
0
0

@sahilmo wrote:

Hi , I am new here. I Want to build a paid video tutorial app. Can any one help me in following points.

  1. How to store video in this case? i dont want you tube or vimeo, I want inbuild video with app. is It Possible.?
    2 . I want user to first subscribe the app after download and then use. Can any one guide me how to do that?

Posts: 1

Participants: 1

Read full topic


Ionic app optimization

$
0
0

@Spsahu wrote:

Hi Team,

Is there any way in Ionic to minify the ts and css file.
As in angular web application, we do minify before pushing the app in prod.

Please help, it will solve my production issue.

Thanks

Posts: 1

Participants: 1

Read full topic

Fastlane finished with errors

$
0
0

@bentz wrote:

[12:36:45]: fastlane finished with errors
WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.4
/Users/ionic/.fastlane/bin/bundle/bin/fastlane: [!] Exit status of command ‘cordova platform add ios’ was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Using cordova-fetch for cordova-ios@4.5.5
Adding ios project…
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: …
Name: …
iOS project created with cordova-ios@4.5.5
Source path does not exist: res/screens/ios/Default-568h@2x~iphone.png
any idea ?

Posts: 1

Participants: 1

Read full topic

Fcm notification on ios don't call onNotification() event?

$
0
0

@joe_c_sleiman wrote:

hi i’m using:
cordova-plugin-fcm-with-dependecy-updated ^2.4.0
@ionic-native/fcm": "^4.18.0

i was using local-notification too, but i removed it (uninstall it) , and i have in my backend code

"click_action":"FCM_PLUGIN_ACTIVITY"

but still till now iphone when receive notification and tap to it doesn’t redirect me to the specific page and ```
fcm.onNotification()

didn't called.
> 
> cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport"
> cordova-plugin-device 1.1.7 "Device"
> cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer"
> cordova-plugin-fcm-with-dependecy-updated 2.4.0 "Cordova FCM Push Plugin"
> cordova-plugin-file 6.0.1 "File"
> cordova-plugin-file-opener2 2.1.3 "File Opener2"
> cordova-plugin-file-transfer 1.7.1 "File Transfer"
> cordova-plugin-fingerprint-aio 1.5.0 "FingerprintAllInOne"
> cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
> cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
> cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
> cordova-plugin-network-information 2.0.1 "Network Information"
> cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
> cordova-plugin-splashscreen 4.1.0 "Splashscreen"
> cordova-plugin-statusbar 2.4.2 "StatusBar"
> cordova-plugin-whitelist 1.3.3 "Whitelist"
> cordova-plugin-x-socialsharing 5.4.3 "SocialSharing"
> es6-promise-plugin 4.2.2 "Promise"
> ionic-plugin-deeplinks 1.0.17 "Ionic Deeplink Plugin"
> ionic-plugin-keyboard 2.2.1 "Keyboard"

do you know any informations?

ionic (Ionic CLI) : 4.0.2
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.0.0, ios 4.5.5

Posts: 1

Participants: 1

Read full topic

Hide Ionic tabs and Toolbar on botton click [Ionic 4.0.0]

$
0
0

@TrulsLoug wrote:

Hi, I was wondering if its possible to hide the Ion-tabs and Ion-toolbar on a button click.

   async toggleFullScreen() {
    const loading = await this.loadingCtrl.create({
      message: "",
      spinner: "lines",
      duration: 2000
    });
    await loading.present();
    const style = document.getElementById("full").style;
    await this.platform.ready();
    const [ data, color] = this.fullscreen === "all" ?
      ["true", "on", "#f2af46"] :
      ["false", "off", "transparent"];
       //TODO write code that hides toolbar and tabs
       //
       //
       //
      loading.dismiss();
     
    localStorage.setItem("Fullbutton", this.fullscreen = data);
    style.backgroundColor = color;
  }

I’d like to run a function like this on a button click, I’ve seen a few posts but they all seem to be about hiding the toolbar/tabs on ngViewDidEnter I’d like to keep the tabs and toolbar until the button was clicked.

Any help or resources that could help with my issue would be greatly appreciated!

Posts: 1

Participants: 1

Read full topic

Force update app

Ionic 3: Part of css not working on Android platform

$
0
0

@rhanesoghlyan wrote:

After building app for Android platform part of css not working.
We didn’t change any dependencies. And problem we have only in some Android devices.

For example we have 2 Samsung Galaxy s8 devices (Android version - 8.0.0)
In one device it works but in other not

in iOS platform all works well

Posts: 1

Participants: 1

Read full topic

How to set styling in ionic 4 by default either Iphone app style or android

$
0
0

@albincs wrote:

Please try this in your index.html file

I tried the below html code in

ionic 4

and it works

Use the below one for getting styled your apk same as ios.

<html lang=“en” dir=“ltr” class=“plt-iphone plt-ios plt-phablet plt-mobile ios” mode=“ios”>

Use the below one for getting styled your ios app same as android.

<html lang=“en” dir=“ltr” class=“plt-android plt-mobile md” mode=“md”>

Posts: 1

Participants: 1

Read full topic


Style broken in android apk build

$
0
0

@tom5677 wrote:

I’m working on a ionic v3 app which were actually already working on ios and android.
Suddenly in the native android app the style is broken. It seems, that some css stylings are not applied.
I’ve tried already lot of things:

  • tried on different android device
  • debug and prod build
  • build locally and via ionic pro
  • remove add android platform
  • upgrade cordova-plugin-ionic-webview to 2.1.0
    No success.
    No error in build process identified.
My ionic info

Ionic:

   ionic (Ionic CLI)  : 4.8.0 (C:\Users\tk\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic 4.2.0, cordova-plugin-ionic-webview 2.0.0, (and 7 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\tk\AppData\Local\Android\Sdk)
   NodeJS            : v6.11.4 (C:\Program Files\nodejs\node.exe)
   npm               : 3.10.10
   OS                : Windows 10

This is from ionic serve and OK

This is from an android device where the style is broken.

Cheers,Tom

Posts: 1

Participants: 1

Read full topic

How to retrieve objects using ionic & angular

$
0
0

@issamahwach wrote:

Hello Everyone,
I’m building a small game that contains a background (table) and four players on it .
I have two buttons (next & previous) when I click next I need to highlight the next player icon (replace the old icon with highlighted one).
the default highlighted icon is for player1.
I’m thinking of a way that can retrieve the next player to highlight it’s icon.

home.html

<ion-header>
  <ion-navbar>
    <ion-title>
      Ionic Blank
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding class="bg-image">
  <ion-grid>
    <ion-row>
      <ion-col>
          <div class="player2" (click)="player2btn()">
            <br><br>
              <img src="assets/imgs/player-2.png" width=100 height=100 id="playert" name="playert">
          </div>
      </ion-col>
      <ion-col>

        <div class="playernamebox">
            <img src="assets/imgs/player name box.png">
        </div>
      </ion-col>
      <ion-col>
        <div class="player3" (click)="player3btn()">
          <br><br>
            <img src="assets/imgs/player-3.png"width=100 height=100>
        </div>
      </ion-col>

    </ion-row>
    <ion-row>
        <div *ngIf="hideme" class= "file" width=50 height=50>
            <img src="assets/imgs/file.png">
            <div class="player-description">{{playernum}}
              <img src="assets/imgs/ok btn.png">
            </div>
            
          </div>
    </ion-row>
    <ion-row>
    <ion-col>
        <div class="player1" (click)="player1btn()">
          <br><br>
            <img src="assets/imgs/player-1h.png" width=100 height=100>
        </div>
      </ion-col>
      <ion-col>
          <div class="player4" (click)="player4btn()">
            <br><br>
              <img src="assets/imgs/player-4.png"width=100 height=100>
          </div>
        </ion-col>
      </ion-row>
      <ion-row>
        <ion-col>
            <div class="previous">
              <br><br>
                <img src="assets/imgs/previous button.png"width=60 height=70>
            </div>
          </ion-col>
          <ion-col>
              <div class="next">
                <br><br>
                  <img src="assets/imgs/next button.png"width=60 height=70 ng-click="selectnext()">
              </div>
            </ion-col>
          </ion-row>
  </ion-grid>
</ion-content>

home.ts

import { Component } from '@angular/core';
import { NavController , NavParams} from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  hideme: boolean;
  name: string;
  playernum:string;
  player1flag: boolean;
  player2flag: boolean;
  player3flag: boolean;
  player4flag: boolean;
  id: number;


  player1btn(){
    this.playernum="P1";
    this.hideme= !this.hideme;
    
  }
  
  player2btn(){
    this.playernum="P2";
    this.hideme= !this.hideme;
    
  }
  player3btn(){
    this.playernum="P3";
    this.hideme= !this.hideme;
    
  }
  player4btn(){
    this.playernum="P4";
    this.hideme= !this.hideme;
    
  }
  nextbtn(){
    this.id=this.id+1;
    switch (this.id){
case 1:{

  break;
}
    }


  }

  constructor(public navCtrl: NavController,public NavParams:NavParams) {
this.player1flag =true;
    
  }
 
}

Posts: 1

Participants: 1

Read full topic

Google Plus Login End Support

$
0
0

@andeokles wrote:

Google+ support ends in 2 months, The Google plus plugin for Ionic will stop working? I am developing an app that uses that kind of login, Should I have to change it to another login or what would you recommend me?

Posts: 1

Participants: 1

Read full topic

Google plus shutting down

$
0
0

@obinnae wrote:

With the pending shutdown of Google+ in March/April, does that mean the Google+ login plugin would stop working? Would there be another way to authenticate Google?

Posts: 1

Participants: 1

Read full topic

How to check my app 64-bit hardware compatibility or not?

$
0
0

@flycoders_sourav wrote:

how to check my app 64-bit hardware compatibility or not? because google play has changed their policy. please help me out any help would be highly appreciated

Please help @Sujan12

Posts: 1

Participants: 1

Read full topic

Viewing all 70434 articles
Browse latest View live


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