Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 49109 articles
Browse latest View live

Generate Barcode Ionic

$
0
0

@vicheanak wrote:

How to generate barcode in Ionic? I searched the Internet and found the solution to only QR Generator, but not the barcode.

Any solutions? Please help.

Thanks.

Posts: 2

Participants: 2

Read full topic


Intercom - ERROR - 'apiKey' parameter must be a valid Intercom iOS SDK API key

$
0
0

@xfernandez wrote:

Hi

I have installed and followed instructions to install cordova plugin for Intercom + the ionic native wrapper. Something strange is happen but when the app is loading I receive this issue

ERROR - ‘apiKey’ parameter must be a valid Intercom iOS SDK API key.

Ant the ios API key is valid

My config.xml for intercom:

I have tried other options like

Nothing work. Any help is welcome :slight_smile:

Posts: 1

Participants: 1

Read full topic

Custom component cache

$
0
0

@gofin_di wrote:

Hello,

I have problem with refreshing my changes made in custom components. “Command+s” is refreshing only pages. I have to restart ionic serve. Cache is disabled in chrome. How can i see my changes everytime i hit save button?

Posts: 1

Participants: 1

Read full topic

How to use a token in a header to GET api

$
0
0

@Louis101 wrote:

createHeaders(headers:Headers) {

let options: IConnectionOptions = { qs:{userId:1, token: '"};

	console.log("Stage 1");
		//Header for 'this.singalR.connect'
    this.signalR.connect(options)
        .then((connection) => {

            console.log("Client Id: " + connection.id);
         }, (err) => {
            console.log("SignalR Error: " + JSON.stringify(err));
        });

this.storage.getItem('token')
.then(
  (token) => { console.log('Bearer ' + token);
    headers.append('Authorization', 'Bearer ' + token);
  },
  (error) => console.error(error)
);

headers.append('AllowEntry', btoa(this.allow_entry));

headers.append('Content-Type', 'application/json');

 this.http.get('http://sportspecific.digitaltesting.net/api/v1/collection/21')

.map(res => res.json())
.subscribe(data => {
this.data = data.data;
console.log(data.data);
});

}

I want to make an API call but I am struggling, this is how far I have got but still having no luck. Thanks in advance for any help

Posts: 1

Participants: 1

Read full topic

Yesterday, there were inexplicable errors

Display Blob Image from server

$
0
0

@vnicolas0 wrote:

Hello, I am using Ionic 3 and working with a REST API that sends image as byte stream.

                   byte[] contents = IOUtils.toByteArray(new FileInputStream(file));
			    HttpHeaders headers = new HttpHeaders();
	            headers.setContentType(MediaType.parseMediaType("image/png"));
	            String filename = file.getName();
	            headers.setContentDispositionFormData(filename, filename);
	            ResponseEntity<byte[]> response = new ResponseEntity<byte[]>(contents, headers, HttpStatus.OK);
	            return response;

With fiddler, the output ImageView is ok.

How do I convert the above to a base64 image data for display in my ionic app?

I have tried a few methods:

myWsService () :{
let obsRes: Observable<Response> = this.http.post(url, options);
return obsRes.map((res: Response) => { return res._body;}).catch(err => this.handleError(err, callMethod));
}
    myWsService().subscribe(

        result => {
          var blob = new Blob([result], {
            type: 'image/png'
          });

          var reader = new FileReader();
          reader.readAsDataURL(blob);
          reader.onloadend = () => {
            this.base64data = reader.result;
            console.log(this.base64data);
          }
        },
        err => {
            // display error
        }
    );
<img style="width:200px;height:200px;" [src]="base64data" />

The base64data shows something like:

data:image/png;base64,77+9UE5HDQoaCgAAAA1JSERSAAADIAAAAlgIBgAAAO+/vXbvv71wAAAAAXNSR0IA77+977+9HO+/vQAAAARnQU1BAADvv73vv70L77+9YQUAAO+/ve+/vUlEQVR4Xu+/vQV4Vlfvv73vv73fj++/vTNnXGpTd3d377+9GnXvv73vv73vv73vv70777+977+977+977+9Bg8ECO+/vUBCQgxi77+977+9BALvv71d77+9Mu+/ve+/vTPvv71/77+977+9We+/vduQ0rTvv73OtDPvv73vv717PV1b77+9Xlvvv73vv73vv73vv71dYn7vv73vv73vv70nP++/ve+/

The converted data doesn’t look right and I think something must be wrong. I am doing my tests via the browser or phone.

Any ideas please?

Posts: 1

Participants: 1

Read full topic

Ngx-translate not working with ios device

$
0
0

@Niavart wrote:

It IS working on ionic serve (all device with chrome), ionic view (ios device and android device), android device (cordova run android) but NOT on iOS device. Keys are displayed instead of translations. Most pages are not lazy loaded.

app.module.ts :

export function createTranslateLoader(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
...
imports: [...,
HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (createTranslateLoader),
        deps: [HttpClient]
      }
    })
]

Since its working on everything but an iOS device, I doubt it’s a implementation in my code problem but I’d really like to make it work and not redo everything with a wonky pipe :confused:

Posts: 1

Participants: 1

Read full topic

Delaying or staggering Permission requests in iOS

$
0
0

@heardnetwork wrote:

I have a local messaging app that uses the camera, location and sends push messages to users. Is there a way to stagger the requests from iOS, and currently they pop up one after the other in about half a second and it’s very jarring for the user.

thanks

Posts: 1

Participants: 1

Read full topic


Azure authentication doesn't trigger any login screen

$
0
0

@flemishguy wrote:

Hi, I’m using ionic view to test my app and the ms-adal plugin to authenticate

This is my code when i click the login button, but nothing is happening… Nothing pops up…
I have searched a lot on this but i’m stuck!

login() {
    var authority = "https://login.microsoftonline.com/XXXX",
    redirectUri = "http://IonicAuthenticationTest",
    resourceUri = "https://graph.windows.net",
    appId = "XXXXXXX";

    let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext(authority);

    authContext.acquireTokenAsync(resourceUri, appId, redirectUri)
    .then((authResponse: AuthenticationResult) => {
    window.alert('Token is' + authResponse.accessToken);
    window.alert('Token will expire on' + authResponse.expiresOn);
    }).catch((e: any) => window.alert('Failed' + e));
  }

Posts: 1

Participants: 1

Read full topic

Image upload to AWS S3 from ionic

Project created in windows does not work in ubuntu (linux)

$
0
0

@victormagalhaespache wrote:

Hello guys,
I have a project developed on windows and the same is already in production. But now, I need to run the same project on ubuntu 16.04 and it has the following problem:

If I run the same project on windows the same works!

Ubuntu version:
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.4.2
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.11.2
Xcode version: Not installed
npm: 3.10

Version in windows 10:
Ionic CLI Version: 3.5
ios-deploy version: Not installed
ios-sim version: Not installed
Node Version: v8.2
npm: 5.3
Xcode version: Not installed
Thanks!

Posts: 3

Participants: 2

Read full topic

Disable Ionic styles completely

$
0
0

@Kraavok wrote:

I’m new to the Ionic/Cordova/Angular scene and am planning to make a completely custom UI application for both desktop and mobile. I want the UI to be consistent across all platforms (more like a responsive website) and so I feel the Ionic UI and components aren’t really a good fit for what I’m going for. However, I don’t really have enough in-depth knowledge yet to set up Cordova and Angular together on my own and in an optimised way, and so Ionic seems like the logical choice.

It’s a shame Ionic is so tightly coupled to the UI but maybe this will change in the future. For now, what is the best course of action to completely exclude the Ionic styles so that I can just use Bootstrap as a base instead?

Also if you have any other, better suggestions for me, I’d be happy to hear them.

Thanks!

Posts: 1

Participants: 1

Read full topic

Prevent Page from Loading while ViewWillEnter lifeCycle

$
0
0

@govindappaarun wrote:

Hi
I am trying to block certain views for App user based on Role,
My logic is to check the View I am just entering, and block the view before it completely loads, so that he will not have access to the restricted pages.

any ways to do so with nav Guards

– in app.component.ts

 this.nav.viewWillEnter.subscribe((view) => {
  let currentModule = view.instance.constructor.name;
 // here I am checking currentModule
// after this I want to conditionally load the pages,
// I am not able to prevent page from entering,
 });

Posts: 1

Participants: 1

Read full topic

How to get AppID of my application to access application data folder in iOS simulator?

$
0
0

@MahaRamesh wrote:

How to get AppID of my application to access application data folder in iOS simulator or ios real device?

Posts: 3

Participants: 2

Read full topic

Problem with background image in apk

$
0
0

@JEricaM wrote:

I’m my html page I have a ion-content with the class getstart, with a background image, placed in assets/img.
It works perfectly into the web browser, but wen I test the app with the apk, the background remains white.

I know that It’s a recurrent question, but all the answers that I found (in this forum or other sites) don’t work for me.

This is my scss code, placed inside app.scss

  .getstart{
    background: url('../assets/img/venice.jpg') no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    background-size: cover;

  }

I tryied changing che image url like ‘/assets/img/venice.jpg’ , but nothing worked.

I’m really stuck :frowning:
Thank you in advance!

Posts: 4

Participants: 2

Read full topic


Not native plugin wrapper

$
0
0

@Thyrion wrote:

Hello,

I would like to use : https://github.com/randdusing/cordova-plugin-bluetoothle
The native BLE is not sufficient for my needs.

I doesn’t want to use the plugin directly and want having Promises or Observables.

So i see a tutorial here :http://www.damirscorner.com/blog/posts/20170908-WritingAnIonicNativeWrapper.html
and more informations here https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md

But it’s not enought for me, i don’t understand where i have to put the wrapper file.

Thanks for you help.

Posts: 1

Participants: 1

Read full topic

Get rid of line at the bottom of html input field

Custom component - failing in --prod mode

$
0
0

@pliablepixels wrote:

I am trying to create a custom component. It works fine in ionic serve and ionic build but fails in ionic build with --prod

The error:

08:52:00]  ngc started ...
Error: Template parse errors:
Can't bind to 'toggleMap' since it isn't a known property of 'earth-map'.

Full log of error: https://gist.github.com/pliablepixels/54d9bd25ee4c5c70b1b3cddae81eb76e

My component.module.ts

import { NgModule,  } from '@angular/core';
import { EarthMapComponent } from './earth-map/earth-map';
import { IonicModule } from 'ionic-angular';

@NgModule({
	declarations: [EarthMapComponent],
	imports: [IonicModule], // needed to use ion-spinner
	exports: [EarthMapComponent]
})
export class ComponentsModule {}

app.module.ts: (I’ve tried importing and commenting out. If I import, it says duplicate definition as the above file already has it)

import { EarthMapComponent } from '../components/earth-map/earth-map';

@NgModule({
  declarations: [
    MyApp,
    FavPage,
    ContactPage,
    SettingPage,
    TabsPage,
    CardListPage,
   // EarthMapComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot({name:'__cardCallDB', driverOrder:['sqlite','websql','indexeddb']}),
    //EarthMapComponent
  ],

earth-map.ts

import { Component, Input} from '@angular/core';
import {  MapAnimation } from '../../animations/animations';


@Component({
  selector: 'earth-map',
  templateUrl: 'earth-map.html',
  animations: [
    MapAnimation

  ]
})
export class EarthMapComponent {
  // if you do ngIf in parent (view), then leave animation
  // of child is not called, so changed it to an input
  @Input() toggleMap: boolean;
  mapLoaded = false;
  constructor() {
  }

  mapLoadedCallback() {
    this.mapLoaded = true;
  }

}

earth-map.html


<ion-item  *ngIf="toggleMap" [@mapAnim] no-padding class="fullItem">
  <div>
    <ion-spinner *ngIf="!mapLoaded" name="bubbles"></ion-spinner>
    <img src="http://api.usno.navy.mil/imagery/earth.png?date=today&ID=PP_CardCall" (load)="mapLoadedCallback()" />
  </div>
</ion-item>

How I invoke it from another page:

in the page ts file

import { EarthMapComponent } from '../../components/earth-map/earth-map';

in page template

  <earth-map [toggleMap]="showWorldMap"></earth-map>

Posts: 1

Participants: 1

Read full topic

Cordova plugin - download from git repo

$
0
0

@AceBoy wrote:

When i install it local using “ionic cordova plugin add path/to/plugin”, it works. But when I create repo from it and download it later somewhere, makes some errors.

My question is how should i edit plugin.xml or other file to achieve this goal - plugin as repo (i can’t use github etc - unfortunately)

Posts: 1

Participants: 1

Read full topic

- Ionic application not getting started

$
0
0

@KathiravanThirumurth wrote:

Error: connect ETIMEDOUT 218.248.255.164:443
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

Ionic application not getting started

H:\PracticeIonic>ionic -v
3.18.0

H:\PracticeIonic>ng -v

Angular CLI: 1.5.2
Node: 8.9.1
OS: win32 x64
Angular:
H:\PracticeIonic>node -v
v8.9.1

I’m a beginner trying to start ionic…but I tried lot for installing.Dont know what’s happening.Any help will be great use to stat.

Posts: 1

Participants: 1

Read full topic

Viewing all 49109 articles
Browse latest View live


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