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

Could 'ionic generate' create a more consistent folder structure?

$
0
0

@josh_sharpe wrote:

I ran generate for all available types:

ionic g page foopage
ionic g component foocomponent
ionic g service fooservice
ionic g module foomodule
ionic g class fooclass
ionic g directive foodirective
ionic g guard fooguard
ionic g pipe foopipe
ionic g interface foointerface
ionic g enum fooenum

and ended up with these new files:

        src/app/fooclass.spec.ts
        src/app/fooclass.ts
        src/app/foocomponent/
        src/app/foodirective.directive.spec.ts
        src/app/foodirective.directive.ts
        src/app/fooenum.enum.ts
        src/app/fooguard.guard.spec.ts
        src/app/fooguard.guard.ts
        src/app/foointerface.ts
        src/app/foomodule/
        src/app/foopage/
        src/app/foopipe.pipe.spec.ts
        src/app/foopipe.pipe.ts
        src/app/fooservice.service.spec.ts
        src/app/fooservice.service.ts

So, class, directive, enum, guard, interface, pipe and service all create files that are in the root of src/app while page, component and module al create their own folders.

Why the inconsistency?

Are page/component/module special somehow? If not, would it be better that things get created in a directory structure like src/app/<type>s/<name>/ ?

Posts: 1

Participants: 1

Read full topic


How to send notifications to devices?

$
0
0

@ioclaudio wrote:

Hi,
I’d like to send notifications (text messages) to the customers that use my Ionic4 app.
This messages will be shown on the app.
The messages should be sent to all customers or selectively to a specific customer.

Is it possible to implement this feature with Ionic4?
Should I use push notifications, MQTT client or there are other ways?

Thank you for your suggestions

cld

Posts: 1

Participants: 1

Read full topic

Split-pane layout for iPad

$
0
0

@Vandem wrote:

Hey there!

We’ve been creating an ionic 4 app with multiple (6) layers and it works great on mobile devices. You can click on each entry, which opens a new page and displays the next layer in the hierarchy.

Now we want to adapt it for tablets (iPad). The idea was to make use of the larger screen and display multiple pages on it at the same time.

One idea was to use ion-split-pane but instead of a menu+page we wanted to have two pages side by side. This didn’t quite work out as it’s not intended for this purpose.

The question now is: is there a way to make this work with split-pane or do any of you have another idea how we could accomplish this “multiple pages per screen” view?

As a backup plan we would use a responsive grid layout where each column would substitute for one of our pages.

Thanks in advance :slight_smile:

Posts: 1

Participants: 1

Read full topic

fcm.onNotification() how to make it synchronous?

$
0
0

@saty932 wrote:

I have to show some content based on fcm data what i fetch but the problem is it’s taking time to fetch data from notification mean while it’s navigating to some other page.I have to wait until fcm data fetched properly.

this.fcm.onNotification().subscribe(data => {
                 if(data.data){
                   //show offers according to notification data
                 }
               else{
               //no fcm data go to offers page show old offers which are in nativestorage
                }

}
});

now the problem is above method triggers when there is notification data other wise it’s not gonna trigger at all.

how should i handle this case??

Posts: 1

Participants: 1

Read full topic

Translation custom loader CORS issue when reading from data directory

$
0
0

@ash-cygnus wrote:

I have created a custom loader for ngx-translate within an Ionic (v4) app. I have done this because I want to download the latest translation files from a server and then save into the data directory so they are accessible when the app is offline.

I have succeeded with this part. However, I am now experiencing issues with CORS within my getTranslation function.

How can I get around this issue?

getTranslation(lang: string): Observable<any> {
    const subDirectory = 'i18n';
    const fileName = lang;
    const fileExtension = '.json';
    let rootDirectory = '';
    let rootDirectoryPath = '';
    let directory = '';
    let directoryPath = '';
    if (this.platform.is('cordova')) {
      this.platform.ready()
        .then(() => {
          rootDirectory = this.file.dataDirectory;
          rootDirectoryPath = rootDirectory;
          directory = rootDirectoryPath + subDirectory;
          directoryPath = directory + '/';
          console.log(directoryPath + fileName + fileExtension + ':');
          this.http
            .get(directoryPath + fileName + fileExtension)
            .pipe(map((res: any) => res))
            .subscribe(translationData => {
              console.log(translationData);
            });
          const translation = this.http.get(directoryPath + fileName + fileExtension);
          return translation;
        });
    } else {
      rootDirectory = '/assets/data';
      rootDirectoryPath = rootDirectory + '/';
      directory = rootDirectoryPath + subDirectory;
      directoryPath = directory + '/';
      const translation = this.http.get(directoryPath + fileName + fileExtension);
      return translation;
    }
  }

Posts: 1

Participants: 1

Read full topic

Setting native version numbers with capacitor?

$
0
0

@josh_sharpe wrote:

With cordova, we could configure a few version numbers using attributes on the tag in config.xml:

<widget
  android-versionCode="1.0"
  ios-CFBundleVersion="1.0"
  version="1.0"
  >

How do we set those such that they make it over to the native project when capacitor is synced?

Posts: 1

Participants: 1

Read full topic

Npm installation error with ionic-cli

Issue while generating apk

$
0
0

@nileshbhagate wrote:

I am able to run application and seems fine with “ionic serve” but when generating apk giving following wrror,

 cordova.cmd build android
cordova-plugin-androidx-adapter: Processed 48 Java source files in 1152ms
Preparing Firebase on Android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=D:\Software\AndroidSDK (DEPRECATED)
Starting a Gradle Daemon, 1 incompatible and 4 stopped Daemons could not be reused, use --status for details
:wrapper

BUILD SUCCESSFUL in 32s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\Edify Now\Other Repo\IR Mobile App_Third_Instance\platforms\android\app\build.gradle' line: 93

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not find com.google.android.gms:strict-version-matcher-plugin:1.1.0.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom
       - https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar
       - https://repo.maven.apache.org/maven2/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom
       - https://repo.maven.apache.org/maven2/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar
     Required by:
         unspecified:unspecified:unspecified > com.google.gms:google-services:4.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 23s
> Configure project :app
E:\Edify Now\Other Repo\IR Mobile App_Third_Instance\platforms\android\gradlew: Command failed with exit code 1 Error output:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\Edify Now\Other Repo\IR Mobile App_Third_Instance\platforms\android\app\build.gradle' line: 93

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not find com.google.android.gms:strict-version-matcher-plugin:1.1.0.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom
       - https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar
       - https://repo.maven.apache.org/maven2/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom
       - https://repo.maven.apache.org/maven2/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar
     Required by:
         unspecified:unspecified:unspecified > com.google.gms:google-services:4.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 23s
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

I am not able to find solution for this. My project configuration is,

Ionic:

   Ionic CLI          : 5.1.0 (C:\Users\Admin\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 17 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.3

System:

   Android SDK Tools : 26.1.1 (D:\Software\AndroidSDK)
   NodeJS            : v10.16.0 (C:\Program Files (x86)\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

Please suggest me the solution.

Thanks,
Nilesh

Posts: 1

Participants: 1

Read full topic


How to set up css/scss global for ionic/[Vue]?

$
0
0

@spocklogical wrote:

Since the install of ionic/vue doesn’t install the unminified css or anything for that matter in the project /src directory, how can I set the css global variables for an ionic/vue project?

Posts: 1

Participants: 1

Read full topic

[ionic4] - by mistake deleted config.xml file

$
0
0

@pantarmj wrote:

I was going to discard some changes from config.xml file. As I did not set up git, it asked me to delete the file when I clicked on discard. And by mistake I deleted the file. Now that deleted config.xml is not present in trash. When I run the command “ionic cordova run browser”, it instantly gives the following error:

[ERROR] Cannot load ./config.xml
        
        Cordova config.xml file not found.

        You can re-add the Cordova integration with the following command: ionic integrations enable cordova --add

Anybody plz help me to recover my config.xml file…

@lucasbasquerotto

Posts: 1

Participants: 1

Read full topic

Android dev builds on API 28/29 show ERR_CLEARTEXT_NOT_PERMITTED

$
0
0

@josh_sharpe wrote:

Seems like a solved problem for cordova. Any way to handle for capacitor?

Posts: 1

Participants: 1

Read full topic

How to write javascript code in typescript

$
0
0

@Tubiss wrote:

var timer;

var compareDate = new Date();
compareDate.setDate(compareDate.getDate() + 9
); //just for this demo today + 7 days

timer = setInterval(function() {
timeBetweenDates(compareDate);
}, 1000);

function timeBetweenDates(toDate) {
var dateEntered = toDate;
var now = new Date();
var difference = dateEntered.getTime() - now.getTime();

if (difference <= 0) {
// Timer done
clearInterval(timer);
} else {
var seconds = Math.floor(difference / 1000);
var minutes = Math.floor(seconds / 60);
var hours = Math.floor(minutes / 60);
var days = Math.floor(hours / 24);

hours %= 24;
minutes %= 60;
seconds %= 60;

$("#days").text(days);
$("#hours").text(hours);
$("#minutes").text(minutes);
$("#seconds").text(seconds);

}
}

Posts: 1

Participants: 1

Read full topic

I'm trying to upload my App for Android TV and the Google team rejects me

$
0
0

@antojsh wrote:

The Google team responds with the following

Your app does not contain a full-size app banner or is it not visible in the launcher. We are targeting 1080P, which we consider xhdpi. Apps should include the banner in the xhdpi (320 dpi) drawables folder with a size of (320px × 180px). Please refer to our Home Screen Banner and UI Patterns documentation.

The title should help users identify apps in the launcher. Please refer to our Visual Design and User Interaction documentation for more information.

For example, your banner does not fill the entire banner space.

The app is developed with ionic 4, how could I solve this inconvenience?

Posts: 1

Participants: 1

Read full topic

Ionic .apk not working in android version 9

$
0
0

@maktest wrote:

I have build the .apk file in ionic version 3. it’s working fine in lower android version 5,6,7,8. but not working in 9 and latest android version(installed successfully in latest version).

My ionic info is:

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)

local packages:

@ionic/app-scripts : 3.2.4
Cordova Platforms  : android 8.0.0 ios 5.0.1
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 25.2.5
Node              : v10.14.2
npm               : 6.4.1
OS                : Windows 7

Posts: 1

Participants: 1

Read full topic

Compile Ionic 4 for Android 9 (Pie)

$
0
0

@jorgetv92 wrote:

Hello. I would like to see how can i compile my finished app for Android 9 (Pie)?
When i try compile my code with ionic build android. was compiled for android 8 (oreo) and that brought me problems because my http.get are not working on android 9, only works on android 8 and less, i tried to compiled with ionic build android@9.0.0, and not works
I need a solution with this issue, Thanks in advance

Posts: 1

Participants: 1

Read full topic


error: process launch failed: Security

$
0
0

@smidhunraj wrote:

When i run ionic cordova run ios --device -- I get the following error…

verbose(lldb) command script add -s asynchronous -f fruitstrap_828bb79436e53a8fe3e9d624710bf67bf3033f89.safequit_command safequit (lldb) connect (lldb) run error: process launch failed: Security (lldb) safequit

Application has not been launched

Command finished with error code

1: ios-deploy --justlaunch,–no-wifi,-d,-b,/Users/sysadmin/new/platforms/ios/build/device/MyApp.app ios-deploy: Command failed with exit code 1 Error: ios-deploy: Command failed with exit code 1 at ChildProcess.whenDone (/Users/sysadmin/new/node_modules/cordova-common/src/superspawn.js:135:23) at ChildProcess.emit (events.js:197:13) at maybeClose (internal/child_process.js:978:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5) [ERROR] An error occurred while running subprocess cordova.

    cordova run ios --device --verbose exited with exit code 1.

    Re-running this command with the --verbose flag may provide more 
    information.

ionic:utils-process onBeforeExit handler: process.exit received +0ms ionic:utils-process onBeforeExit handler: running 2 functions +0ms ionic:utils-process onBeforeExit handler: exiting (exit code 1) +43ms

Posts: 1

Participants: 1

Read full topic

Local notification exit my device

$
0
0

@ahmedGrati wrote:

i’m working with android , so when i try to run it on an emulator it works perfectly but when i run it on a real device it crushes and the app exits so i’m asking if you know the problem . Reminder : i’m working with android
Also i check my device settings because at first i thought that notification settings were the problem but their configuration was fine i’m so confused what’s the problem

i’m using android version 7.1.1

Posts: 1

Participants: 1

Read full topic

Ionic v3 Icon button bug on iOS

$
0
0

@redpike wrote:

Hello,

I have big trouble with icon buttons on iOS. On Android it works perfect, but on iOS I have problem with borders on icon inside buttons… I can’t fix them.

icons

My HTML file looks like:

SCSS:

scss

Please, give me solution for that :slight_smile:

Posts: 1

Participants: 1

Read full topic

Error: ENOENT: no such file or directory, open 'platforms/android/app/build/outputs/apk/debug/app-debug.apk'

$
0
0

@JayT wrote:

Hello,

I have created an app with ionic v3. I am facing issue while running live reload build on a real android device.

> native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --connect --forward 8100:8100
[native-run] Selected hardware device 8a0ad564
[native-run] Error: ENOENT: no such file or directory, open 'platforms/android/app/build/outputs/apk/debug/app-debug.apk'
[ERROR] An error occurred while running subprocess native-run.

initially, when it was running, that time the debug apk file path was
’platforms/android/build/outputs/apk/android-debug.apk’

but not the path is
’platforms/android/app/build/outputs/apk/debug/app-debug.apk’

I am not able to figure it out exactly what is the cause, I have tried by upgrading versions of these - cordova, ionic-cli, native-run, cordova-android, Android Studio

Here is the ionic info

$ ionic info
       
Ionic:

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

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed
   native-run  : 0.2.6

System:

   Android SDK Tools : 26.1.1 (/Users/apple/Library/Android/sdk)
   NodeJS            : v11.11.0 (/usr/local/bin/node)
   npm               : 6.7.0
   OS                : macOS High Sierra
   Xcode             : Xcode 10.1 Build version 10B61

I have installed the android platform but it not showing in the info

$ sudo ionic cordova platform add android
Platform android already exists.

Posts: 1

Participants: 1

Read full topic

Alternative time picker for ionic

$
0
0

@wekas wrote:

I want a time picker without a scroll like ion-datetime.
I am looking at Angular time pickers but none of them work that well with ionic.

Does anyone know any good options?

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>