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

Blank project gives white screen with capacitor

$
0
0

@sanyos07 Ok so i found the issue on my side. Maybe its the same for you?

make sure you’re using:

ionic build --aot
npx cap sync

and in your capacitor.config.json have:

"webDir": "www",

The problem on my end was i was syncing the ‘src’ directory and not doing the --aot build.

Hope this helps!


Adding image to alert controller

$
0
0

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Cordova_not_available in real device using facebook login

$
0
0

im using

**import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook/ngx';**

this plugin for fb login in my app . but when i click the login event . the error occur as **Cordova_not_available**

why this happen??

Adding image to alert controller

$
0
0

Thanks very much for the reply. I tried it but actually can’t see any effect of style mods to the display. Here’s my code (including a one second dismissal - just wanted a quick preview):

this.alertCtrl.create({
header: card.title,
message: <img src="${card.imageUrl}" style="border-radius: 2px">,
// message: <img src="${card.imageUrl}" style="height: 10px;width: 10px">,
//message: <img src="${card.imageUrl}" alt="g-maps" style="border-radius: 2px" width="100" height="100" crop="fill">,
buttons: [’’]
}).then (alertEl => {
alertEl.present();
setTimeout( () => {
alertEl.dismiss();
}, 1000)
});

The image is narrow and tall - 200x334 - and the alert cuts the bottom off - here’s a screenshot:

imageInAlert

Ionic 5 auto complete

$
0
0

Try downgrading the Ionic Selectable component to v4.4.0.

npm install ionic-selectable@4.4.0

Adding image to alert controller

$
0
0

Try defining a css class selector at the global.scss file in your project and add the class to your image. Should work for u as well.

global.css

.card-alert {
    width: 100px;
    height 100px;
}

component.ts
const alert = await this.alert.create({
      header: 'boo',
      message: `<img src="${card.imageUrl}" class="card-alert">`
})

      await alert.present();

Make sure that the class selector is loaded from a global style sheet, otherwise it won’t work.

Ionic 5 auto complete

$
0
0

ok will try thanks for your reply

Cordova tries to add a plugin as a platform on ionic cordova platform add ios

$
0
0

Hey everyone! So I recently upgraded to cordova ios 5.1.1 and cordova 9.0.0 and I am having issues when I first run

ionic cordova platform add ios

My version of ionic cli is 6.9.2

Actually, when I try to add the platform I see the following:

which says that cordova is trying to add a plugin as a platform and it fails. However, when I run this exact same command it works.

The cordova-plugin-voippush is in a plugin tag at the end of my config.xml file:

<plugin name="cordova-plugin-voippush" spec="file:scripts/accuv_custom_cordova_plugins/cordova-plugin-voippush" />

Does anyone know what this glitch is and how I can fix this? Thanks!


How can I dynamically schedule local notifications (or conditionally send them) in a Capacitor/React project?

$
0
0

To make a long story short, I need to schedule notifications according to the phases of the moon. I’ve got code which will tell me what phase of the moon it is on any given day. Given that modern civilizations don’t follow lunar calendars, I’m having trouble figuring out how to schedule these notifications with Ionic.

Ideally, I’d want code that works sort of like a cron job; every day, check to see if today’s phase differs from yesterday’s. If so, notify!

However, it seems that’s not possible. I can schedule a notification for every day, but I don’t see any way to prevent a notification from being sent if a condition isn’t met.

Alternatively, I’ve tried coming up with a more complex solution:

Upon app start:
  - are there notifications scheduled?
    - yes: do nothing
    - no: schedule the first one for the next phase of the moon
Upon notification being sent:
  - schedule a notification to be sent during the next phase of the moon

However, that second half appears to be difficult. I couldn’t figure out how to trigger the localNotificationReceived event, and localNotificationActionPerformed isn’t quite correct because I can’t assume the user will take action on the notification.

I also tried using the cordova-plugin-local-notifications package, which has a bit more functionality, but I couldn’t for the life of me figure out how to use it within a Capacitor/React project. Judging by their docs, though, I would still need to go the more complex route laid out above.

I’m not really sure how to accomplish what I need to, and the docs are incredibly slim. Any help would be appreciated.

Ionic 4 back button not working

Adding image to alert controller

$
0
0

oh yes! Thanks so much!!! Now we’re getting somewhere. I’m not strong enough in css land - but this helped greatly - I can shrink the image enough so it fits. Much gratitude!

Ion-icon color does not change when ion-tab-button is selected

$
0
0

If you remove color property from svg file you can use this code:

<ion-icon src="../../assets/no upcoming ride/icon-upcoming@3x.svg" color="primary"></ion-icon>

How can I schedule local notification specific day in every week?

WKWebView is being used but Apple keeps refusing the app

Unhandled Promise rejection: cordova-plugin-ionic not found

$
0
0

Getting this error, when I have applied the Ionic Deploy API in my project.
Unhandled Promise rejection: cordova-plugin-ionic not found. Are you sure you installed it? ; Zone: ; Task: setTimeout ; Value: cordova-plugin-ionic not found. Are you sure you installed it?
I have installed the plugin correctly through ionic deploy add… Can anybody help here please?


How to disable side menu are some pages

$
0
0

What if I want to disable a button based on a condition inside the side menu? The condition needed to check will be available only after I login to the application. In the app.component.ts I’m defining my pages like

this.pages = [
 {
   title: "a",
   component: aPage,
   src: "..",
 }, ......, {}
]

And in my app.html I’m using ngFor inside a button to loop through the pages to display like

<ion-menu [content]="content side="right persistent="true" (ionOpen)="openMenu()">
 <ion-header>
 ......
 </ion-header>
 <ion-content>
  <ion-list>  
  <button 
      id="{{p.title}} 
      menuClose 
      ion-item 
     *ngFor="let p of pages"
     (click)="openPage(p)"
   ><span>{{p.title}}</span></button>
  </ion-list>
 </ion-content>
</ion-menu>

I want to disable a button based on a condition hot to do that ?

Ionic React blank screen on Android

$
0
0

Hi there, I am new to Ionic, and i decided to try Ionic/React with Capacitor. I got the usual problem of the blank screen after splash screen on Android device.
The first error i got on the log is:

E/ApkAssets: Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
E/ApkAssets: Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin

And here is the full log:

06/03 11:37:53: Launching ‘app’ on Pixel 2 API 24.
$ 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 6588 on device ‘Pixel_2_API_24 [emulator-5554]’.
Capturing and displaying logcat messages from application. This behavior can be disabled in the “Logcat output” section of the “Debugger” settings page.
I/art: Not late-enabling -Xcheck:jni (already on)
W/art: Unexpected CPU variant for X86 using defaults: x86
W/System: ClassLoader referenced unknown path: /data/app/io.ionic.starter-1/lib/x86
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
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/ResourceType: Invalid package identifier when getting bag for resource number 0x00000000
I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2436)
at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:779)
at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:552)
at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:161)
at void com.getcapacitor.BridgeActivity.init(android.os.Bundle, java.util.List) (BridgeActivity.java:55)
at void io.ionic.starter.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:16)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6662)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1118)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2599)
at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2707)
at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1460)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String) (ActivityThread.java:6077)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:866)
at void com.android.internal.os.ZygoteInit.main(java.lang.String) (ZygoteInit.java:756)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “android.view.View$OnUnhandledKeyEventListener” on path: DexPathList[[zip file “/data/app/io.ionic.starter-1/base.apk”],nativeLibraryDirectories=[/data/app/io.ionic.starter-1/lib/x86, /system/lib, /vendor/lib]]
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2436)
at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:779)
at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:552)
at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:161)
at void com.getcapacitor.BridgeActivity.init(android.os.Bundle, java.util.List) (BridgeActivity.java:55)
at void io.ionic.starter.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:16)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6662)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1118)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2599)
at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2707)
at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1460)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
I/art: at void android.app.ActivityThread.main(java.lang.String) (ActivityThread.java:6077)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:866)
at void com.android.internal.os.ZygoteInit.main(java.lang.String) (ZygoteInit.java:756)
W/System: ClassLoader referenced unknown path: /system/app/Chrome/lib/x86
I/WebViewFactory: Loading com.android.chrome version 51.0.2704.90 (code 275509012)
I/cr_LibraryLoader: Time to load native libraries: 5 ms (timestamps 4831-4836)
I/cr_LibraryLoader: Expected native library version number “51.0.2704.90”, actual native library version number “51.0.2704.90”
W/ResourceType: Invalid package identifier when getting bag for resource number 0x00000000
Invalid package identifier when getting bag for resource number 0x00000000
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {6bb3d60}
I/cr_LibraryLoader: Expected native library version number “51.0.2704.90”, actual native library version number “51.0.2704.90”
I/chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
E/ApkAssets: Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
E/ApkAssets: Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin
D/: HostConnection::get() New Host Connection established 0xa0137780, tid 6588
D/EGL_emulation: eglCreateContext: 0xa1e62960: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xa1e62960: ver 2 0 (tinfo 0xab9e7bd0)
W/cr_media: Requires BLUETOOTH permission
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
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
I/cr_Ime: ImeThread is not enabled.
E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
D/: HostConnection::get() New Host Connection established 0x8fe503c0, tid 6639
D/Capacitor/LN: LocalNotification received: null
Activity started without notification attached
D/Capacitor: App started
D/Capacitor/App: Firing change: true
V/Capacitor/App: Notifying listeners for event appStateChange
D/Capacitor/App: No listeners found for event appStateChange
D/Capacitor: App resumed
I/art: Background sticky concurrent mark sweep GC freed 30548(1864KB) AllocSpace objects, 15(372KB) LOS objects, 45% free, 4MB/8MB, paused 5.019ms total 453.733ms
D/EGL_emulation: eglCreateContext: 0x8ff43320: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x8ff43320: ver 2 0 (tinfo 0x9fe60370)
V/Capacitor/Network: Notifying listeners for event networkStatusChange
D/Capacitor/Network: No listeners found for event networkStatusChange
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
D/: HostConnection::get() New Host Connection established 0x8f1c78c0, tid 6642
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without…
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xa4805060: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xa4805060: ver 2 0 (tinfo 0xa487fcc0)
W/art: Attempt to remove non-JNI local reference, dumping thread
D/EGL_emulation: eglMakeCurrent: 0xa4805060: ver 2 0 (tinfo 0xa487fcc0)
W/art: Attempt to remove non-JNI local reference, dumping thread
D/Capacitor: Handling local request: http://localhost/
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 6588
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: true
D/cr_Ime: [InputMethodManagerWrapper.java:68] hideSoftInputFromWindow
W/Capacitor/Console: File: capacitor-runtime.js - Line 57 - Msg: Advance console logging disabled.
D/Capacitor: Handling local request: http://localhost/static/css/12.8921c4c4.chunk.css
D/Capacitor: Handling local request: http://localhost/static/css/main.ec2f7cf6.chunk.css
W/Capacitor/Console: File: http://localhost/ - Line 1070 - Msg: The key “viewport-fit” is not recognized and ignored.
D/Capacitor: Handling local request: http://localhost/static/js/runtime-main.8397bf2d.js
D/Capacitor: Handling local request: http://localhost/static/js/12.6aa42ace.chunk.js
D/Capacitor: Handling local request: http://localhost/static/js/main.c6ded30f.chunk.js
D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png
W/art: Attempt to remove non-JNI local reference, dumping thread
E/Capacitor/Console: File: http://localhost/static/js/12.6aa42ace.chunk.js - Line 2 - Msg: Uncaught (in promise) TypeError: Object.entries is not a function
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread

Ionic 4 NavController back() function doesn't use page transitions

$
0
0

In my Ionic 4 app, I’m using Angular routing to redirect to a customer edit page. This page may be called from multiple pages in my app.

Since I don’t necessarily know which page I need to redirect back to when I save, I’m using the NavController .back() function to return to the calling page.

The .back() function works as far as navigating back to the previous page, but it doesn’t have page transitions. It just sort of pops the previous page up instead of sliding it into view.

Is there a better way to return back to whatever page called me instead of using NavController with transitions?

Create ionic 4 Project

$
0
0

Hello Everyone, I’ve installed the latest version of Ionic CLI using npm install -g @ionic/cli and when I create a new project with ionic start command, this command creates Ionic 5 Project as you can see below:

"dependencies": {

    "@angular/common": "~9.1.6",

    "@angular/core": "~9.1.6",

    "@angular/forms": "~9.1.6",

    "@angular/platform-browser": "~9.1.6",

    "@angular/platform-browser-dynamic": "~9.1.6",

    "@angular/router": "~9.1.6",

    "@capacitor/core": "2.1.2",

    "@ionic-native/core": "^5.0.7",

    "@ionic-native/splash-screen": "^5.0.0",

    "@ionic-native/status-bar": "^5.0.0",

    "@ionic/angular": "^5.0.0",

    "rxjs": "~6.5.1",

    "tslib": "^1.10.0",

    "zone.js": "~0.10.2"

  }

How can I create Ionic 4 Project instead of Ionic 5 Project. Thank you

LaunchNavigator is not recognizing google maps on iOS

$
0
0

Anyone that finds this looking for the solution, you need to add this into your Info.plist

  <key>LSApplicationQueriesSchemes</key>
  <array>
    <string>citymapper</string>
    <string>comgooglemaps</string>
    <string>navigon</string>
    <string>transit</string>
    <string>waze</string>
    <string>yandexnavi</string>
    <string>uber</string>
    <string>tomtomhome</string>
    <string>com.sygic.aura</string>
    <string>here-route</string>
    <string>moovit</string>
    <string>lyft</string>
    <string>mapsme</string>
    <string>cabify</string>
    <string>baidumap</string>
    <string>taxis99</string>
    <string>iosamap</string>
  </array>
Viewing all 231637 articles
Browse latest View live


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