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

ITMS-90338: Non-public API usage in ionic

$
0
0

@Lyhout wrote:

Hi dear, I got some feedback from Apple about my delivery app to App Store.
Here is :
ITMS-90338: Non-public API usage - The app references non-public selectors in Pencil Portal: _setAlwaysRunsAtForegroundPriority:. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

I don’t how to fix it. because I’m fresher with app store deploying.

Posts: 1

Participants: 1

Read full topic


ITMS-90683: Missing Purpose String in Info.plist in ionic

$
0
0

@Lyhout wrote:

Hello Y’all, I got some feedback from Apple when I delivery the app to App Store.
ITMS-90683: Missing Purpose String in Info.plist - Your app’s code references one or more APIs that access sensitive user data. The app’s Info.plist file should contain a NSPhotoLibraryUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn’t contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

How do I fix it?
please help

Posts: 1

Participants: 1

Read full topic

Ionic v4 tabs navigates to page instead of hosting it

$
0
0

@mbithik wrote:

I have created a tabs page in ionic v4 but every-time I navigate to the tabs page it goes straight to the default page. for example, if my tabs page is set up as below

<ion-tabs>

  <ion-tab-bar slot="bottom" color="primary">
    <ion-tab-button tab="tab1">
      <ion-icon name="home"></ion-icon>
      <ion-label>Home</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="tab2">
      <ion-icon name="apps"></ion-icon>
      <ion-label>Feed</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="tab3">
      <ion-icon name="settings"></ion-icon>
      <ion-label>Settings</ion-label>
    </ion-tab-button>
  </ion-tab-bar>

</ion-tabs>

and routing like

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TabsPage } from './tabs.page';

const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children:
      [
        {
          path: 'tab1',
          children:
            [
              {
                path: '',
                loadChildren: '../tab1/tab1.module#Tab1PageModule'
              }
            ]
        },
        {
          path: 'tab2',
          children:
            [
              {
                path: '',
                loadChildren: '../tab2/tab2.module#Tab2PageModule'
              }
            ]
        },
        {
          path: 'tab3',
          children:
            [
              {
                path: '',
                loadChildren: '../tab3/tab3.module#Tab3PageModule'
              }
            ]
        },
        {
          path: '',
          redirectTo: '/tabs/tab1',
          pathMatch: 'full'
        }
      ]
  },
  {
    path: '',
    redirectTo: '/tabs/tab1',
    pathMatch: 'full'
  }
];

@NgModule({
  imports:
    [
      RouterModule.forChild(routes)
    ],
  exports:
    [
      RouterModule
    ]
})
export class TabsPageRoutingModule {}

if I attempt to navigate to ‘/tabs/tab1’ the page tab1 is loaded and the tabs bar is not displayed

Posts: 1

Participants: 1

Read full topic

Ionic 4 angular 8 strange issue with reactive forms

$
0
0

@Pratikjaiswa15 wrote:

I am a firebase phone authentication in my ionic app. After success, I redirect users to details page which asks the user for name and email. But there is a strange problem. After redirecting, the formcontrols name and email are always invalid even though the right values are typed. If I refresh the page then, it is working fine.

I can’t get what is going wrong. I have used invisible ReCaptcha for firebase phone authentication if that matters

Thank you in advance here is the code

.ts

userDetails = this.fb.group({
    name : ['', [Validators.required, Validators.minLength(3), Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*') ] ],
    Email : ['', [ Validators.required , Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}
```) ]],
  })

 submit(email, name ){

    console.log(email)
    console.log(name)

}

.html


 <form [formGroup] = "userDetails">

      <ion-card>
        <ion-item>
            <ion-label position="floating">Enter your name</ion-label>
            <ion-input formControlName = "name" type = "text"></ion-input>
        </ion-item>
        <div style="color:red; padding-top: 0.2rem" *ngIf= "name.invalid && name.touched">
          <small *ngIf = "name.errors?.required"  class="text-danger"> name is required</small>
          <small *ngIf = "name.errors?.minlength" class="text-danger"> name must be at least 3 characters </small>
          <small *ngIf = "name.errors?.pattern" class="text-danger"> Enter valid name </small>

       </div>
          <br>
        <ion-item>
        <ion-label position="floating">Enter your email </ion-label>
          <ion-input formControlName = "Email" type = "text"></ion-input>
        </ion-item>

          <div style="color:red; padding-top: 0.2rem" *ngIf= "Email.invalid && Email.touched">
          <small *ngIf = "Email.errors?.pattern" class="text-danger"> Enter a valid email address </small>

          </div>

          <br>
          <br>
          <ion-button type="submit" [disabled]="!userDetails.valid" (click)="submit(Email.value, name.value )">Submit</ion-button>
        </ion-card>


      </form>

Sometimes it also shows this error

Uncaught (in promise) Timeout (g)

Posts: 1

Participants: 1

Read full topic

Ionic help

$
0
0

@shoakbar wrote:

I created app (shopping cart).How I can send data from app to Telegram or Gmail.In my app selecting products, I must know who is select and how many products selected.I hope I clarified the essence

Posts: 1

Participants: 1

Read full topic

Ionic 4 modal error

Ionic Data Storage and the Webkit Intelligent Tracking Prevention enhancements (iPadOS/iOS 13.4 and Safari 13.1 on macOS)

Ionic iOS large title background

$
0
0

@felixliu wrote:

Hi, I’m creating an iOS App with ionic 5. I’d like to use the large title that introduced in ionic 5 (https://ionicframework.com/docs/api/title#collapsible-large-titles). What I want to do is to set a background color for the title part (both ion-header and the header in the top of ion-content), and for ion-content background it’s another color.

I set background for ion-header, and it looks okay for static page. The problem I’m facing is that as the iOS page have a bounce effect, when the page is pulled a little bit down, there will be a space between the fixed ion-header and the second header bar, which will show the color of content background, as the image suggested.

What I want is that the white space becomes the same color as the the title background and the ion-content keep using white. I just tried to put a layer under it to prevent it looks normal, I’d like to ask does any know some better solution? Any suggestion is welcomed, thanks in advance.

Posts: 1

Participants: 1

Read full topic


Ionic Gestures

$
0
0

@Mmadzharov wrote:

Hey Guys. Now that there is Ionic Gestures. Is there event for holding ? Or we still have to do it on our own ?

Posts: 2

Participants: 2

Read full topic

Wheel selector inside content

$
0
0

@nicobytes wrote:

Hello!
Is there a chance for using a wheel selector like ion-picker in a content?

The wheel selector works right in an overlay but if I want this selector in content?

The goal is to include that selector like this.

Posts: 4

Participants: 2

Read full topic

Hide scroll bar

"Type 'HealthOriginal' is not a constructor function type." when extending native-plugin Health

$
0
0

@dansolhan wrote:

I’m following these instructions on how to mock native-plugins. Trying this leads to the error in the title.

I am using Ionic 5. Has the way to mock native plugins changed dramatically?

Posts: 3

Participants: 2

Read full topic

Question regarding the Ionic Natvie Printer

$
0
0

@alanmontgomery19 wrote:

Hi all,

I’m utilising the ionic native printer.

I’ve got a modal with some styled content (external SCSS file) and 2 images in here.

When i use the printer plugin like:

LocalPrinter.print(document.getElementById("print-modal").innerHTML, LocalPrintOptions);

I obviously lose the styling and also the images don’t come through to the Print Preview popup on the native dialog.

My question is - How can i include the CSS and images so they also appear?

Thanks,
Alan

Posts: 3

Participants: 2

Read full topic

Modal: ERROR Error: Uncaught (in promise): overlay does not exist

$
0
0

@error264 wrote:

Hi All,

I have tried to find a solution to a common problem which i have realised a few people have had regarding the dismiss of the modal.

As for my modal structure, i have a page which calls a modal and a button within that which calls another modal

Page 1 --> Modal A --> Modal B

The issue is that Modal B closes without a problem If i use a function on the ion-item which then returns the correct parameter. However, with router link embedded in my HTML the modal does not redirect - maybe router link only works with pages?

When the category is selected and returns to Modal A and an attempt is made to close it, this returns ‘ERROR Error: Uncaught (in promise): overlay does not exist’ if the close button is clicked.

selling-tab.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';

import { IonicModule } from '@ionic/angular';

import { SellingTabPage } from './selling-tab.page';
import { AddProductComponent } from './add-product/add-product.component';
import { CategoryComponent } from './category/category.component';

const routes: Routes = [
  {
    path: '',
    component: SellingTabPage
  }
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    RouterModule.forChild(routes),
  ],
  declarations: [SellingTabPage,
    AddProductComponent,
    CategoryComponent,
    ],
    entryComponents: [AddProductComponent, CategoryComponent,]
})
export class SellingTabPageModule {}

category.component.ts

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ModalController } from '@ionic/angular';
import { NgModule } from '@angular/core';


@Component({
  selector: 'app-category',
  templateUrl: './category.component.html',
  styleUrls: ['./category.component.scss'],
})
export class CategoryComponent implements OnInit {

 categoryOptions = [
    'Item 1',
    'Item 2',
    'Item 3',];

constructor(
    private route: Router,
    private modalCtrl: ModalController
  ) { }

ngOnInit() {
  }
  
  async close() {
    await this.modalCtrl.dismiss();
  }

  async getCategory(event){

    let selected: any;

    try {
       selected = event.detail.value;
       console.log(selected + ' has been selected');

    } catch (error) {
      console.log(error.message);
    }

  }

}

category.component.html

<ion-header>
  <ion-toolbar>
    <ion-title>Select Category</ion-title>
    <ion-buttons slot="end">
      <ion-button (click)="close()">
        <ion-icon slot="icon-only" name="close"></ion-icon>        
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>
<ion-content>

  <ion-list>
    <ion-radio-group (ionChange)="getCategory($event)">
      <ion-item *ngFor="let category of categoryOptions" [routerLink]="['/add-product']" [queryParams]="{ type: category }" routerDirection="back">
        <ion-label>{{category}}</ion-label>
        <ion-radio value={{category}} slot="end"></ion-radio>
      </ion-item>
    </ion-radio-group>
  </ion-list>


</ion-content>

More code can be showed if needed or if any files are missing

Thanks in Advance

Posts: 1

Participants: 1

Read full topic

Array of Array

$
0
0

@RobeNogueira145 wrote:

Hello, I´m beginner at Ionic and I´m doing an app.
I need 4 arrays in array and I have this code:

tudo = {

divisao: [],

figura: [],

tempo: [],

quantidade: []

}

And this give me a error, what I should do?

Posts: 1

Participants: 1

Read full topic


Ionic 5: ion-header turns black in iOS using ionic lab

$
0
0

@ebellempire wrote:

I’ve created a new app using ionic start appname blank --type=angular and made a few very small changes. For some reason, the header area appears to be in dark mode, but only in iOS, and only most of the time (if I make an edit to the HTML it will sometimes go back to normal).

The only changes I’ve made to the blank template were to create a few pages using ionic g and create a split-pane menu. (See code below.)

discover.page.html

// discover.page.html (my default page)
<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-menu-button></ion-menu-button>
    </ion-buttons>
    <ion-title>Discover</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
  <ion-header collapse="condense">
    <ion-toolbar>
      <ion-title size="large">Discover</ion-title>
    </ion-toolbar>
  </ion-header>

  <div id="container">
    <strong>Ready to create an app?</strong>
    <p>
      Start with Ionic
      <a
        target="_blank"
        rel="noopener noreferrer"
        href="https://ionicframework.com/docs/components"
        >UI Components</a
      >
    </p>
  </div>
</ion-content>

app.component.html

// app.component.html
<ion-app>
  <ion-split-pane contentId="main">
    <ion-menu contentId="main">
      <ion-header>
        <ion-toolbar>
          <ion-title>Menu</ion-title>
        </ion-toolbar>
      </ion-header>
    </ion-menu>

    <ion-router-outlet id="main"></ion-router-outlet>
  </ion-split-pane>
</ion-app>

ionic info


Ionic:

   Ionic CLI                     : 6.2.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.5
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.2.0

Capacitor:


   Capacitor CLI   : 1.5.1
   @capacitor/core : 1.5.1

Utility:

   cordova-res (update available: 0.11.0) : 0.8.1
   native-run                             : not installed

System:

   NodeJS : v13.2.0 (/usr/local/Cellar/node/13.2.0/bin/node)
   npm    : 6.13.6
   OS     : macOS Catalina

Any help or insights would be appreciated. Thanks! --E

Posts: 1

Participants: 1

Read full topic

Detect device rotation/orientation in Ionic 4 without rotating app

$
0
0

@sshipsey wrote:

Is it possible to detect rotation in an Ionic4 app without actually rotating the entire app?
I’m using this:


I’d like to enter some callback on device rotation, not necessarily rotating the entire app. If I lock orientation, i lose the screenOrientation.onChange() emits. If I unlock rotation, my screenOrientation.onChange() emits, but the app also rotates. Attempting something like this:

this.screenOrientation.unlock();
this.screenOrientation.onChange().subscribe(ev => {
        this.screenOrientation.lock(
          this.screenOrientation.ORIENTATIONS.PORTRAIT_PRIMARY
        );
        // Do other stuff
});

makes the rotation jump between the two which looks bad. Been fighting this for a while, any ideas are appreciated :confused:

Posts: 1

Participants: 1

Read full topic

Debugger in chrome dose not paused app

$
0
0

@anton_klochko wrote:

Hi all ! Could anyone suggest please, what I need to do to debug app in browser ? I try to do like this, but app dose not paused.

function myBrokenFunction() {
debugger;
// do other stuff
}

Posts: 1

Participants: 1

Read full topic

App not performing same on Android device as desktop after running npx cap open anroid

$
0
0

@Sweg wrote:

I am trying to run my ionic app on an Android device using npx cap open android.
When I run on my desktop (npm serve), it displays fine, but the app is not performing the same on my Android device (i.e. parts of the home component aren’t being displayed)

Here is my console output, can someone please tell me why this is happening:

03/25 17:32:00: Launching ‘app’ on samsung SM-G965F.
$ adb shell am start -n “io.ionic.starter/io.ionic.starter.MainActivity” -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 22381 on device ‘samsung-sm_g965f-2410169c6d0c7ece’.
Capturing and displaying logcat messages from application. This behavior can be disabled in the “Logcat output” section of the “Debugger” settings page.
E/Zygote: isWhitelistProcess - Process is Whitelisted
E/Zygote: accessInfo : 1
I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c130,c258,c512,c768, pkgname=io.ionic.starter
I/o.ionic.starte: Late-enabling -Xcheck:jni
E/o.ionic.starte: Unable to peek into adb socket due to error. Closing socket.: Connection reset by peer
D/ConnectivityManager_URSP: Ursp sIsUrsp=false, sIsCheckUrsp=false, uid=10642
D/Proxy: urspP is null: 10642
W/FirebaseApp: Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.
I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
W/o.ionic.starte: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
W/o.ionic.starte: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
E/o.ionic.starte: Invalid ID 0x00000000.
W/o.ionic.starte: Accessing hidden method Landroid/view/View;->getAccessibilityDelegate()Landroid/view/View$AccessibilityDelegate; (light greylist, linking)
W/o.ionic.starte: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/o.ionic.starte: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
I/WebViewFactory: Loading com.android.chrome version 80.0.3987.149 (code 398714932)
E/o.ionic.starte: Invalid ID 0x00000000.
E/o.ionic.starte: Invalid ID 0x00000000.
I/cr_LibraryLoader: Loaded native library version number “80.0.3987.149”
W/o.ionic.starte: Accessing hidden method Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z (light greylist, reflection)
D/ConnectivityManager: requestNetwork; CallingUid : 10642, CallingPid : 22381
D/ConnectivityManager: requestNetwork; CallingUid : 10642, CallingPid : 22381
D/Capacitor: Starting BridgeActivity
D/Capacitor: Registering plugin: App
D/Capacitor: Registering plugin: Accessibility
D/Capacitor: Registering plugin: BackgroundTask
D/Capacitor: Registering plugin: Browser
D/Capacitor: Registering plugin: Camera
D/Capacitor: Registering plugin: Clipboard
D/Capacitor: Registering plugin: Device
D/Capacitor: Registering plugin: LocalNotifications
D/Capacitor: Registering plugin: Filesystem
D/Capacitor: Registering plugin: Geolocation
D/Capacitor: Registering plugin: Haptics
D/Capacitor: Registering plugin: Keyboard
D/Capacitor: Registering plugin: Modals
D/Capacitor: Registering plugin: Network
D/Capacitor: Registering plugin: Permissions
D/Capacitor: Registering plugin: Photos
D/Capacitor: Registering plugin: PushNotifications
D/Capacitor: Registering plugin: Share
D/Capacitor: Registering plugin: SplashScreen
D/Capacitor: Registering plugin: StatusBar
D/Capacitor: Registering plugin: Storage
D/Capacitor: Registering plugin: Toast
D/Capacitor: Registering plugin: WebView
E/Capacitor: Unable to read file at path public/plugins
D/Capacitor: Loading app at http://localhost
W/o.ionic.starte: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (light greylist, reflection)
W/cr_media: Requires BLUETOOTH permission
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
W/AudioCapabilities: Unsupported mime audio/ac4
W/AudioCapabilities: Unsupported mime audio/x-ima
W/AudioCapabilities: Unsupported mime audio/x-ape
W/AudioCapabilities: Unsupported mime audio/eac3-joc
W/AudioCapabilities: Unsupported mime audio/mpeg-L1
W/AudioCapabilities: Unsupported mime audio/mpeg-L2
W/AudioCapabilities: Unsupported mime audio/x-ms-wma
D/Capacitor/Plugin/LN: LocalNotification received: null
Activity started without notification attached
D/Capacitor: App started
D/Capacitor/Plugin/App: Firing change: true
V/Capacitor/Plugin/App: Notifying listeners for event appStateChange
D/Capacitor/Plugin/App: No listeners found for event appStateChange
W/VideoCapabilities: Unrecognized profile 4 for video/hevc
D/Capacitor: App resumed
W/VideoCapabilities: Unsupported mime video/mp43
D/OpenGLRenderer: Skia GL Pipeline
D/EmergencyMode: [EmergencyManager] android createPackageContext successful
W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
Unrecognized profile/level 32768/2 for video/mp4v-es
Unrecognized profile/level 32768/64 for video/mp4v-es
W/VideoCapabilities: Unsupported mime video/wvc1
W/VideoCapabilities: Unsupported mime video/wvc1
W/VideoCapabilities: Unsupported mime video/x-ms-wmv7
W/VideoCapabilities: Unsupported mime video/x-ms-wmv8
D/InputTransport: Input channel constructed: fd=131
D/ViewRootImpl@edef802[MainActivity]: setView = DecorView@80c6513[MainActivity] TM=true MM=false
D/ConnectivityManager: requestNetwork; CallingUid : 10642, CallingPid : 22381
D/ConnectivityManager: requestNetwork; CallingUid : 10642, CallingPid : 22381
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
D/Capacitor: Handling local request: http://localhost/
D/ViewRootImpl@edef802[MainActivity]: dispatchAttachedToWindow
D/ViewRootImpl@edef802[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 493865160704} changed=true
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/OpenGLRenderer: eglCreateWindowSurface = 0x72f573a180, 0x72fca85010
D/InputTransport: Input channel constructed: fd=145
D/ViewRootImpl@528b903[MainActivity]: setView = android.widget.ImageView{607e080 V.ED… …ID 0,0-0,0} TM=true MM=false
D/InputTransport: Input channel constructed: fd=146
D/ViewRootImpl@84a84ac[MainActivity]: setView = android.widget.ProgressBar{52f1575 I.ED… …ID 0,0-0,0} TM=true MM=false
V/Capacitor/Plugin/Network: Notifying listeners for event networkStatusChange
D/Capacitor/Plugin/Network: No listeners found for event networkStatusChange
D/ViewRootImpl@528b903[MainActivity]: dispatchAttachedToWindow
D/ViewRootImpl@528b903[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 493745364992} changed=true
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/OpenGLRenderer: eglCreateWindowSurface = 0x72f5898280, 0x72f5846010
D/ViewRootImpl@84a84ac[MainActivity]: dispatchAttachedToWindow
D/ViewRootImpl@84a84ac[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[477,1047][603,1173] result=0x1 surface={valid=false 0} changed=false
D/ViewRootImpl@edef802[MainActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 39) vi=Rect(0, 63 - 0, 39) or=1
D/ViewRootImpl@edef802[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@80c6513[MainActivity]
getNavigationBarColor() -855310
D/InputMethodManager: prepareNavigationBarInfo() DecorView@80c6513[MainActivity]
getNavigationBarColor() -855310
V/InputMethodManager: Starting input: tba=io.ionic.starter ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager: startInputInner - Id : 0
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/ViewRootImpl@528b903[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() android.widget.ImageView{607e080 V.ED… …ID 0,0-1080,2220}
getNavigationBarColor this view is not DecorView or null
getNavigationBarColor() Fail
D/InputMethodManager: prepareNavigationBarInfo() android.widget.ImageView{607e080 V.ED… …ID 0,0-1080,2220}
getNavigationBarColor this view is not DecorView or null
getNavigationBarColor() Fail
V/InputMethodManager: Starting input: tba=io.ionic.starter ic=null mNaviBarColor Fail mIsGetNaviBarColorSuccess false , NavVisible : true , NavTrans : false
D/InputMethodManager: startInputInner - Id : 0
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport: Input channel constructed: fd=150
D/InputTransport: Input channel constructed: fd=154
D/ViewRootImpl@528b903[MainActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 39) vi=Rect(0, 63 - 0, 39) or=1
W/InputMethodManager: Ignoring onBind: cur seq=41878, given seq=41877
D/InputTransport: Input channel destroyed: fd=150
D/ViewRootImpl@edef802[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@80c6513[MainActivity]
getNavigationBarColor() -855310
D/Capacitor: Handling local request: http://localhost/runtime-es2015.js
D/Capacitor: Handling local request: http://localhost/polyfills-es2015.js
D/Capacitor: Handling local request: http://localhost/styles-es2015.js
D/Capacitor: Handling local request: http://localhost/vendor-es2015.js
D/Capacitor: Handling local request: http://localhost/main-es2015.js
I/Capacitor/Console: File: http://localhost/vendor-es2015.js - Line 69837 - Msg: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
D/Capacitor: Handling local request: http://localhost/common-es2015.js
D/Capacitor: Handling local request: http://localhost/5-es2015.js
D/Capacitor: Handling local request: http://localhost/home-home-module-es2015.js
I/Capacitor/Console: File: http://localhost/vendor-es2015.js - Line 117994 - Msg: Ionic Native: deviceready event fired after 525 ms
W/Capacitor/Console: File: http://localhost/vendor-es2015.js - Line 118299 - Msg: Native: tried calling StatusBar.styleDefault, but the StatusBar plugin is not installed.
W/Capacitor/Console: File: http://localhost/vendor-es2015.js - Line 118311 - Msg: Install the StatusBar plugin: ‘ionic cordova plugin add cordova-plugin-statusbar’
File: http://localhost/vendor-es2015.js - Line 118299 - Msg: Native: tried calling SplashScreen.hide, but the SplashScreen plugin is not installed.
File: http://localhost/vendor-es2015.js - Line 118311 - Msg: Install the SplashScreen plugin: ‘ionic cordova plugin add cordova-plugin-splashscreen’
D/Capacitor: Handling local request: http://localhost/swipe-back-d2cdbf9a-js-es2015.js
V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 95296127, pluginId: Geolocation, methodName: watchPosition
V/Capacitor: callback: 95296127, pluginId: Geolocation, methodName: watchPosition, methodData: {}
V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 95296128, pluginId: App, methodName: addListener
V/Capacitor: callback: 95296128, pluginId: App, methodName: addListener, methodData: {“eventName”:“backButton”}
D/Capacitor: Handling local request: http://localhost/tap-click-606f325e-js-es2015.js
D/Capacitor: Handling local request: http://localhost/status-tap-2ec46489-js-es2015.js
D/Capacitor: Handling local request: http://localhost/focus-visible-70713a0c-js-es2015.js
D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png
D/TcpOptimizer: TcpOptimizer-ON
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/Capacitor/Console: File: http://localhost/home-home-module-es2015.js - Line 2740 - Msg: new position: [object Object]
D/Capacitor: SplashScreen was automatically hidden after the launch timeout. You should call SplashScreen.hide() as soon as your web app is loaded (or increase the timeout).Read more at https://capacitor.ionicframework.com/docs/apis/splash-screen/#hiding-the-splash-screen
W/libEGL: EGLNativeWindowType 0x72f5846010 disconnect failed
D/OpenGLRenderer: eglDestroySurface = 0x72f5898280, 0x72f5846000
D/ViewRootImpl@528b903[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl@528b903[MainActivity]: dispatchDetachedFromWindow
D/ViewRootImpl@528b903[MainActivity]: Surface release. android.view.ViewRootImpl.doDie:7954 android.view.ViewRootImpl$ViewRootHandler.handleMessage:4955 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:214 android.app.ActivityThread.main:6986 java.lang.reflect.Method.invoke:-2 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:494 com.android.internal.os.ZygoteInit.main:1445
D/InputTransport: Input channel destroyed: fd=145
D/ViewRootImpl@edef802[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@80c6513[MainActivity]
getNavigationBarColor() -855310
D/InputMethodManager: prepareNavigationBarInfo() DecorView@80c6513[MainActivity]
getNavigationBarColor() -855310
V/InputMethodManager: Starting input: tba=io.ionic.starter ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager: startInputInner - Id : 0
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport: Input channel constructed: fd=147
Input channel destroyed: fd=154
E/ViewRootImpl: sendUserActionEvent() returned.
I/Capacitor/Console: File: http://localhost/home-home-module-es2015.js - Line 2740 - Msg: new position: [object Object]

Posts: 1

Participants: 1

Read full topic

How to set coordinates of Google Map when ionic app loads using Geolocation?

$
0
0

@Sweg wrote:

am trying to load Google Maps into my Ionic app, & center the map on my current coordaintes using Geolocation.

Below I am retrieving the long & lat of my current location, & assigning the values to local variables:

constructor(private afAuth: AngularFireAuth, private afs: AngularFirestore) {
    this.anonLogin();
  }

  anonLogin() {
    this.afAuth.auth.signInAnonymously().then(res => {
      this.user = res.user;
      this.isTracking = true;
      this.watch = Geolocation.watchPosition({}, (position, err) => {
        if (position) {
          this.lat = position.coords.latitude;
          this.lng = position.coords.longitude;
        }
      });
    });
  }

And here is where I’m creating the map:

ionViewWillEnter() {
    this.loadMap();
  }

  loadMap() {
    let latLng = new google.maps.LatLng(this.lng, this.lat);
    let mapOptions = {
      center: latLng,
      zoom: 5,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
  }

In loadMap() . this.lng & this.lat are null. But in anonLogin() , they’re the correct values.

How can I center my map on these co-ordinates when the app / map loads?

Posts: 1

Participants: 1

Read full topic

Viewing all 49526 articles
Browse latest View live


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