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

Ionic: Widgets

$
0
0

@Llarian wrote:

Hi there,

as far as I know there is no official way to create a widget with Ionic.
I need a widget that has no more functionality than displaying some status values from my app.

Shouldn’t it be possible to create a native widget, using Android Studio or something, send a completely composed Html including the values via intent, let the widget receive and display it?
I have never worked with intents, is it possible to create one without any needed interaction with the user and restrict it to only work between my widget and my app?

In case the described communication is possible shouldn’t it then also be possible to create a widget with some more functionality like reacting to a click and send a message to the app triggering an action? Like using a RPC?

Or are these thoughts complete nonsense?

Posts: 1

Participants: 1

Read full topic


Ionic app post json to gmap

$
0
0

@thecrowjulian wrote:

Hi there to all!
Im developing an app with ionic v2 and im facing a problem that i cant resolve.
My aplication is supposed to track the location of several users and display the tracking on a gmap on an admin website, Is there a possibility of storing the lat and lng values in a json and then post that json x times a day to the gmap on the admin web page? Is this possible? Any help will be appreciated. Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Error trying to read NFC card on Ionic 3

$
0
0

@derman10 wrote:

I’m stuck for weeks trying read NFC card from my ionic project.

Running the app on a real device (Samsung S7 Edge with Android).

I’m following this:

Then, I installed the plugin on my project:

ionic cordova plugin add phonegap-nfc

npm install @ionic-native/nfc

Only need read the Card Tag Id into the variable tagId (string) to show it.

My source:

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { NFC, Ndef } from '@ionic-native/nfc/ngx';

@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    NFC,
    Ndef,
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

home.ts

import { Component } from '@angular/core';
import { NavController, Platform, AlertController, ToastController } from 'ionic-angular';
import { NFC, Ndef } from '@ionic-native/nfc/ngx';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  tagId: string;

  constructor(public platform: Platform,
              private alertCtrl: AlertController, 
              private toastCtrl: ToastController,
              public navCtrl: NavController, 
              private nfc: NFC,
              private ndef: Ndef) {

    this.platform.ready().then(() => { 
      this.addListenNFC();
    });

  } // del constructor

    addListenNFC() {
      console.log('entra a addListenNFC');

      this.nfc.addNdefListener(() => {
        console.log('successfully attached ndef listener');
      }, (err) => {
        console.log('error attaching ndef listener', err);

        let toast = this.toastCtrl.create({
          message: err,
          duration: 1000,
          position: 'bottom'
        });

        toast.present(); 

      }).subscribe((event) => {
        console.log('received ndef message. the tag contains: ', event.tag);
        console.log('decoded tag id', this.nfc.bytesToHexString(event.tag.id));
      
        let toast = this.toastCtrl.create({
          message: this.nfc.bytesToHexString(event.tag.id),
          duration: 1000,
          position: 'bottom'
        });

        toast.present(); 

      });

    }
 
}

home.html

<ion-content padding>
<h1>Please Scan Access Card</h1>
<ion-card>
<ion-card-content>
<p>Account Tag ID: {{ tagId }}</p>
</ion-card-content>
</ion-card>
</ion-content>

I’m getting the following error in the console:

Why do I get this error when adding the listener?
What is wrong??

Thanks.

Posts: 1

Participants: 1

Read full topic

Dissappointed with Ionic support and the forums

$
0
0

@mrchrisf wrote:

Definitely dissappointed with Ionic support for free accounts and the Forum.

  1. Forum: Posted a question on the forum 9 days ago and no replyies. Had to figure out the problem for myself. This is one reason I don’t generally like forums as “support”: no replies, or unreliable replies. I recognize that I might have created this issue by my own dumbness, but at least someone could have responded to tell me I’m an idiot!
<ol>
<li>Forum: Posted a question on the forum 9 days ago and no replys. Had to figure out the problem for myself. This is one reason I don't generally like forums as "support". No replies, or unreliable replies.</li>
<li>Support: Received a non-answer to a problem with Creator stuck in 'saving' mode. I was told to delete a complex app in Creator and continue editing in the CLI.  What good is Creator if I have to use the CLI anyway.?</li>
</ol>

Probably will not be accessing Support, or the Forum anytime in the near future.

Posts: 1

Participants: 1

Read full topic

How To Modify Native Code (Android) In An Existing Cordova Plugin

$
0
0

@meatloaf4 wrote:

Hey guys I had a hell of time figuring out what the best way to modify the native Android code for an exiting Cordova plugin was. Here’s a quick write up below.

  1. Fork the cordova plugin you want to modify.
  2. Clone it locally to your computer.
  3. Navigate to https://github.com/apache/cordova-android and download the repo.
  4. Extract downloaded cordova-android .zip previously downloaded.
  5. Locate framework folder and pull into new directory.
  6. Rename framework folder to project name of your choosing.
  7. Open newly renamed framework folder in Android Studio.
  8. In Android Studio create a new package with the name that matches the package name of the Android plugin files.
  9. Copy all .java files from locally cloned cordova plugin to newly created android studio package (Ctrl+c, Ctrl+v with package highlighted in Android Studio works best).
  10. You now have code completion for Android / java / plugin working
  11. Now in order to push updates to forked cloned repo, you have the following options
    11a. Setup an auto file replace from Android Studio project package name folder -> android folder in cloned repo
    11b. Manually copy files in Andriod Studio project you changed & paste them into android folder in cloned repo (mark as replace all).

The last bit step 11 could use some work, but overall I hope this helps someone!

Posts: 3

Participants: 2

Read full topic

Trying to update cordova-plugin-ionic-webview to 2.3.1

$
0
0

@mamzellejuu wrote:

I know that we need to update the cordova-plugin-ionic-webview for security issue.

I have to support IOS 10.

I have in my config.xml
<plugin name="cordova-plugin-ionic-webview" spec="2.3.1"> <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" /> </plugin>

but I have problem when i run
ionic cordova platform add ios@4.5.4

it update the plugin to 3.1.1 automatically and update my package.json to 3.1.1 also.

Do someone know why it doesn’t respect my fixed version ?

Posts: 1

Participants: 1

Read full topic

Ionic Storage Favorite Bug

$
0
0

@hasankilic wrote:

Hi everyone, i have a problem. When i click the favorite button, button add favorite local storage and favorite page. But when i exit in app and again open app and i click the favorite button the old favorite item has gone. A new item has comed.

Could you help me? What should i do?
Thanks.
My code is below.

Posts: 1

Participants: 1

Read full topic

Left align ionic-title in the navbar?

$
0
0

@adboio wrote:

I’ve been searching for hours but can’t seem to find (or make) a way to do this. My header is:

<ion-header>
  <ion-navbar>
    <ion-title><h1><strong>Aftercare Inbox</strong></h1></ion-title>
  </ion-navbar>
</ion-header>

It is center-aligned by default, and I’ve tried playing with align-title, padding, margins, anything I can think of, but nothing seems to move it. Any ideas?

Posts: 2

Participants: 2

Read full topic


[Angular] Angular animations

$
0
0

@zabka229 wrote:

Hello i am trying to create animation.
Demo:

My problem is that I can’t center this whole button so it would be on center of screen all of the time instead of going to the left side of screen.

Posts: 2

Participants: 2

Read full topic

Android ionic-plugin-keyboard already exists

$
0
0

@lqrz wrote:

Im trying to add an Android platform to my project, but when i run ionic cordova platform add android im getting this error:

Subproject Path: app
Installing “ionic-plugin-keyboard” for android
Error during processing of action! Attempting to revert…
Failed to install ‘ionic-plugin-keyboard’: CordovaError: Uh oh!
“…/platforms/android/app/src/main/java/io/ionic/keyboard/IonicKeyboard.java” already exists!

Why is this happening? I dont have any ionic-plugin-keyboard on my package.json or config.xml.

Thanks!

Posts: 1

Participants: 1

Read full topic

Ionic Angular (Ionic v3) 3.9.3 was released!

$
0
0

@Sujan12 wrote:

My bot caught another release of 3.9.3:

The release is here: https://github.com/ionic-team/ionic/releases/tag/v3.9.3
But the release note there look pretty broken (currently lists all changes ever done to Ionic I think).

Correct ones are actually here: https://github.com/ionic-team/ionic-v3/blob/master/CHANGELOG.md#393-2019-02-01

Bug Fixes

  • accessibility: disable icon label if tab has title (98c5d7e)
  • alert: allow disabled text input (1b3190b), closes #13488
  • content: remove layout contain to fix fab behind toolbar (79c8d67)
  • cordova: don’t apply safe area to footer if there are bottom tabs (0182014)
  • sass: use sass variables for slide background values (3d0713d)
  • toggle: add display: block to ensure proper track dimension calculation (68d0a922), closes #919

Notes

This release of ionic-angular brings full Node 10 support.

Posts: 1

Participants: 1

Read full topic

64-bit version for Google Play Store?

$
0
0

@alextrep wrote:

Hey!

Google has announced that all new apps and apps updates that use native code will have to provide a 64-bit version on the store.

I don’t know how Cordova or Capacitor handle native code under the hood so I was wondering if that would affect apps built using Ionic?

Posts: 1

Participants: 1

Read full topic

How can add bootstrap in ionic3 slider option(introduction page)

$
0
0

@gokulanathan wrote:

I’m working on ionic 3 with slider option(introduction page), in that i need to add a effect as “fade” using bootstrap. Is there any way to add bootstrap in ionic.

Thanks in advance…

Posts: 1

Participants: 1

Read full topic

Unhandled Promise rejection: Arguments array must have arguments. ; Zone: ; Task: Promise.then ; Value: Error: Arguments array must have arguments

$
0
0

@TechCreationZ wrote:

Here is the ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.9.0 (/home/sahith/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.0
   @ionic/angular-toolkit        : 1.3.0

System:

   NodeJS : v8.10.0 (/usr/bin/node)
   npm    : 6.7.0
   OS     : Linux 4.15

I don’t know why this error is coming

Posts: 1

Participants: 1

Read full topic

Run background service even after kill / close the app

$
0
0

@lavanyaifet wrote:

Run a Background Service in Ionic 4 even after close / kill the app by user.
Firebase push notification works in foreground, background, app killed/ Close.
I want to open app immediately push notification received,
(it works if click the notification, want to open immediately received notification without click in full screen)
Note: background-mode work only in foreground / background, not work if app is killed / closed
For that I want to run a background service to watch the push notification, and force to open app or open ui (like whatsapp),
Is there any other solution, please share .

Posts: 1

Participants: 1

Read full topic


Ionic 4 native http get empty data in html

$
0
0

@aligassan wrote:

I am beginner in ionic 4. And I am trying to get json data from an api using native http. My code is working fine with a json data response, but the problem is I got empty data in html

json

{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}

main code :

import { Component } from '@angular/core';
import { HTTP } from '@ionic-native/http/ngx';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  object : any  ;
  constructor(private http: HTTP) {
   this.http.get('https://jsonplaceholder.typicode.com/todos/1',{},{})
   .then(res=> {

    this.object = res.data

  })    .catch(error => this.object = error);
  }


}

if l use only object in html he is return json response

 {{object}}

but if l want get title form data json l got empty page

 {{object.title}}

Posts: 1

Participants: 1

Read full topic

Ionic 3 in ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at UniqueDeviceID.get

$
0
0

@umeshsingsysy wrote:

I am using ionic 4 laetst updated cli

  1. ionic start demoTest blank --type= ionic-angular
    then install UniqueDeviceID plugin

ERROR Error: Uncaught (in promise): TypeError: Object(…) is not a function
TypeError: Object(…) is not a function
at UniqueDeviceID.get (index.js:27)
at app.component.ts:17
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.js:4760)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.js:4751)
at t.invokeTask (polyfills.js:3)
at UniqueDeviceID.get (index.js:27)
at app.component.ts:17
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.js:4760)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.js:4751)
at t.invokeTask (polyfills.js:3)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.js:4751)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
at e.invokeTask [as invoke] (polyfills.js:3)
at p (polyfills.js:2)
at HTMLDocument.v (polyfills.js:2)
defaultErrorLogger @ core.js:1449
ErrorHandler.handleError @ core.js:1510
IonicErrorHandler.handleError @ ionic-error-handler.js:61
next @ core.js:5508
schedulerFn @ core.js:4342
SafeSubscriber.__tryOrUnsub @ Subscriber.js:242
SafeSubscriber.next @ Subscriber.js:189
Subscriber._next @ Subscriber.js:129
Subscriber.next @ Subscriber.js:93
Subject.next @ Subject.js:55
EventEmitter.emit @ core.js:4322
(anonymous) @ core.js:4782
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
NgZone.runOutsideAngular @ core.js:4708
onHandleError @ core.js:4782
t.handleError @ polyfills.js:3
r.runGuarded @ polyfills.js:3
(anonymous) @ polyfills.js:3
n.microtaskDrainDone @ polyfills.js:3
o @ polyfills.js:3
e.invokeTask @ polyfills.js:3
p @ polyfills.js:2
v @ polyfills.js:2

Posts: 1

Participants: 1

Read full topic

Google map With current location marker in Ionic 3

$
0
0

@ramashish wrote:

I am building an app in which i want to use google map and i am using ionic version 3.20.1 and cordova version 8.xx

I want to use google maps java script API and make my map appear like it looks on most of the applications. screen shots - what i want to built


what i was able to built

my map.html contains
<ion-header>
  <ion-navbar>
    <ion-title>
      Map
    </ion-title>
    <ion-buttons end>
      <button ion-button (click)="addMarker()"><ion-icon name="add"></ion- 
icon>Add Marker</button>
    </ion-buttons>  
  </ion-navbar>
</ion-header>

<ion-content>
  <div #map id="map"></div>  
</ion-content>

and my map.tas contains following code

import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Geolocation } from '@ionic-native/geolocation';

declare var google;

@IonicPage()
@Component({
  selector: 'page-google-map',
  templateUrl: 'google-map.html',
})
export class GoogleMapPage {
  @ViewChild('map') mapElement: ElementRef;
  map: any;

  constructor(public navCtrl: NavController, public navParams: 
NavParams,public geolocation: Geolocation) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad GoogleMapPage');
    this.loadMap();
  }

  loadMap(){

this.geolocation.getCurrentPosition().then((position) => {

  let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

  let mapOptions = {
    center: latLng,
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
  this
}, (err) => {
  console.log(err);
});

  }
      addMarker(){

    let marker = new google.maps.Marker({
      map: this.map,
      animation: google.maps.Animation.DROP,
      position: this.map.getCenter()
    });

    let content = "<h4>Information!</h4>";          

    this.addInfoWindow(marker, content);

  }
      addInfoWindow(marker, content){

    let infoWindow = new google.maps.InfoWindow({
      content: content
    });

    google.maps.event.addListener(marker, 'click', () => {
  infoWindow.open(this.map, marker);
    });

  }
 }

_ I strongly need that blue dot showing current location_
https://stackoverflow.com/q/54492887/8381721

Posts: 1

Participants: 1

Read full topic

Is @ionic-native-camera working in v4 with latest webview?

$
0
0

@webprofusion wrote:

Hi Folks,
Has anyone got native Camera working in v4 with the latest webview (3.x)?

I’m trying to grab either a photo from the library or from the camera but get a file URI. I then convert that to http://localhost/… using webview.convertFileSrc() , I then try to load the image to process it but get an error in vendor.js and I’m stuck there. This is android and I’m checking the logs using Monitor.

Posts: 1

Participants: 1

Read full topic

App rejected by play store

$
0
0

@jyprksh001 wrote:

I am using SMS and call plugin in my app and when i submit my app to play store i am getting this email.(cordova plugin sms,mx.ferreyra.callnumber)
" We reviewed your app and found that it does not qualify for use of the requested permissions.
Next steps: Submit your app for another review

  1. Read through the Permissions policy and the Play Console Help Center article, which describes intended uses, exceptions, invalid uses, and alternative options for use of Call Log or SMS permissions.

  1. Make appropriate changes to your app.
  2. Sign in to your Play Console and submit the update to your app."

I am not sure where is the mistake. please help

Posts: 2

Participants: 2

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>