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

Alarm like feature in ionic

$
0
0

@KamayaniT wrote:

Hi,
I am trying to build a reminder app using Ionic 4.
I have tried following plugins for the same :
BackGround-Fetch
Wakeup- Timer
Local - Notifications

Background-fetch doesnt work if I terminate app.
Local notifications don’t work if I terminate app.

Any idea what can be done ?
Thanks & Regards

Posts: 1

Participants: 1

Read full topic


Voip on Local Network

Modal controller does not work on ion-slide

$
0
0

@gsoulie wrote:

Hi all,

I am facing an issue with a simple modal controller (only one ion-label and one ion-button)

When i call it inside a ion-slide, the modal controller is unresponsive.

If i call it inside a classic ion-content, it works perfectly.

Anyone got an idea ?

Posts: 1

Participants: 1

Read full topic

How to check if Filesystem functions are working?

$
0
0

@VictorNorman wrote:

I am trying to store downloaded mp3 audio files into storage somewhere so that I can play them with the html <audio> tag.

I have been trying to store the files in FilesystemDirectory.Data using Capacitor’s Filesystem API. I don’t get an error when I do the copying, which I assume means the copies are working. However, I’m unable to play them, which makes me wonder if the copies are working.

How can I browser the FilesystemDirectory.Data directory to confirm that the copying is working? I’ve used Android Studio’s Device File Explorer, but have found no files in /data/data/…/etc., which makes me think the copying is failing.

Any other ideas? thanks.

Vic

P.S. Here is my code to store the files:

export const fileWrite = (fname: string, data: string) => {
  try {
    Filesystem.writeFile({
      path: fname,
      data,
      directory: FilesystemDirectory.Data,
      encoding: FilesystemEncoding.UTF8
    });
  } catch (e) {
    console.error('Unable to write file', e);
  }
};

Posts: 1

Participants: 1

Read full topic

Ionic camera in ios

$
0
0

@pinoyprogs wrote:

hi got a problem in ionic camera with ios.
When I used the camera in only gives me a full black display but when I took a picture.
It Display.

My question is their any fix for this.?
Because before I take a picture. everything’s is black
Thanks more power.

Posts: 1

Participants: 1

Read full topic

java.util.concurrent.TimeoutException issue in google play crash logs

$
0
0

@Sudarshana_Dayananda wrote:

I have published app on google play store. It shows below exception in app crash logs.

java.util.concurrent.TimeoutException: 
  at android.content.res.AssetManager$AssetInputStream.close (AssetManager.java:566)
  at android.content.res.AssetManager$AssetInputStream.finalize (AssetManager.java:599)
  at java.lang.Daemons$FinalizerDaemon.doFinalize (Daemons.java:191)
  at java.lang.Daemons$FinalizerDaemon.run (Daemons.java:174)
  at java.lang.Thread.run (Thread.java:818)

Please help me to fix this issue.

Posts: 1

Participants: 1

Read full topic

Unable to set image on html tag img src in ionic3

$
0
0

@rajputsachin wrote:

i am unable to understand what path i should use to show image on UI img src tag please help.

let options = {
quality: 30,
allowEdit: true,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
saveToPhotoAlbum: false,
correctOrientation: true,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}

this.camera.getPicture(options).then((imagePath) => {
  
  if (this.platform.is('android')) {
    this.filePath.resolveNativePath(imagePath)
      .then(filePath => {
        this.setPhotoOnUI = filePath;
        
        this.lastImage = this.createFileName();
        // let correctPath = filePath.substr(0, filePath.lastIndexOf('/') + 1);
        // let currentName = imagePath.substring(imagePath.lastIndexOf('/') + 1, imagePath.lastIndexOf('?'));
        // this.copyFileToLocalDir(correctPath, currentName, this.createFileName());
      });
  } else {
    // var currentName = imagePath.substr(imagePath.lastIndexOf('/') + 1);
    // var correctPath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1);
    // this.copyFileToLocalDir(correctPath, currentName, this.createFileName());
  }
});

Posts: 1

Participants: 1

Read full topic

Angularfire Firebase

$
0
0

@Tamsel wrote:

I am using angularfire library , i have not included firebase library but getting and error as fontVariantsettings not found. How can i change firebase to be updated

Posts: 1

Participants: 1

Read full topic


Opening ionic modal from ionic popup disables ionic popup buttons

$
0
0

@aevargas wrote:

I have an item which can be clicked and uses this function to display a popup:

$scope.view_item = function()
{
    // builds template here
    // builds buttons, etc

    $scope.ionicPopup = $ionicPopup.alert({
        title: "",
        template: template,
        cssClass: "custom-popup-1",
        scope: $scope,
        buttons: [ 
            {
                text    : "Confirm",
                type    : "",
                onTap   : ontapConfirm
            },
            {
                text    : "Cancel",
                type    : "",
                onTap   : ontapCancel
            }
        ]
    });
}

In this popup, I have a “Reason” field which allows users to select from a number of reasons using a modal. I am using an ng-repeat inside a modal instead of a <select> field for this. When the field is clicked, it calls this function:

$scope.open_reason_options = function()
{
    $scope.ionicPopup.close();

    $scope.modal = $ionicModal.fromTemplate(
    '<ion-modal-view cache-view="false">' +
        '<ion-header>' +
            '<ion-nav-bar align-title="center">' +
                '<ion-nav-buttons side="left"><button class="button button-icon ion-close-round" ng-click="closeModal();"></button></ion-nav-buttons>' +
                '<ion-nav-title>Select Reason</ion-nav-title>' +
            '</ion-nav-bar>' +
        '</ion-header>' +

        '<div class="outer-page-panel">' +
            '<ion-content class="has-header">' +
                '<ion-list>' +
                    '<span ng-repeat="reason in reasons">' +   
                        '<ion-radio class="hide-icon" ng-click="onReasonSelect(reason);" ng-model="line.reason" ng-value="reason.reason_code" ng-if="reason.reason_code != \'\'">' +
                            '<span class="radio-list-items">' +
                                '<h2 ng-bind="reason.description"></h2>' +
                            '</span>' +
                        '</ion-radio>' +
                    '</span>' +
                '</ion-list>' +
            '</ion-content>' +
        '</div>' +
    '</ion-modal-view>',
    {
        scope : $scope,
        animation: 'slide-in-up'
    });

    $scope.modal.show();
}

So the idea is that it closes the popup so it focuses on the modal so the user can select a reason. When I click the close button I have added on the modal navigation bar it calls this function:

$scope.closeModal = function()
{
    $scope.modal.hide();
    $scope.modal.remove();
    $scope.view_item();
}

Since the user did not select a reason, I want it to return to the popup with the rest of the data and make no changes. I do that by hiding and removing the current modal and then calls the view_item() function again to display the popup.

Once the popup re-opens, I can’t do anything on it. I can’t click the buttons at all. Any ideas on how to solve this?

Posts: 1

Participants: 1

Read full topic

I want to image from another page

$
0
0

@premktr wrote:

in my edit profile page(different page), i can change the profile pic and it should reflect the same in main profile page(another page).these two pages are different.

 <ion-item lines="none">
            <ion-avatar class="ion-align-self-left" id="pic" (click)="change()">

              <img src="{{myphoto}}">
            </ion-avatar>
          </ion-item>
export app{
 myphoto: any;
}
constructor(private camera: Camera,private statusBar: StatusBar) {
    this.myphoto = '/assets/img/DP.svg';

    this.statusBar.backgroundColorByHexString('#ffffff');
   }

Posts: 1

Participants: 1

Read full topic

In Ionic / Angular How to Set Header? When call API I got Error 405 (Method Not Allowed)

$
0
0

@jvilas10 wrote:

In Postman API Working perfectly , When I call the API in My Project I got Error 405 (Method Not Allowed)
Access to XMLHttpRequest at 'http://abc.com/api’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
I Am Use below code for Set Header
var options = {
headers: new HttpHeaders({
‘Access-Control-Allow-Origin’ : ‘*’,
‘Content-Type’ : ‘application/json’,
authorization : ‘Basic bW9iaWxlYXBpdXNlcjpwYXNzd29yZDEh’,
}),
}

return this.http.get('http://localhost/basicapi/index.php', options);

Posts: 1

Participants: 1

Read full topic

Watch position - making app to restart after 50 mins

$
0
0

@wibits wrote:

Hi,
I am doing a realtime app with ionic. watch position is making app to restart after some mins when the screen is off. It is happening below the android version 8. Please help us to fix this soon.

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Cloned app with new app id still live updating the original app

$
0
0

@stemsoftware wrote:

I’m not sure why my app is still live updating to the old app after I cloned the app. I created a new app on app flow and copied the app id into the app.module,config.xml(for Cordova Plugin Ionic), package.json, and even package.lock.json. I created a new .ipa and bundle identifier for the app and uploaded it to a server and it works perfect when first downloaded but when the live update hits, it reverts back to the old app. I haven’t had this problem before, but I’m sure everything referencing the old app is now referencing the new app.

Any help would be appreciated.

Posts: 1

Participants: 1

Read full topic

Discord for Ionic developer

IONIC 4/CLI 5.0.3 - run android error

$
0
0

@NurGuz wrote:

Hi guys,

I have this error when run in android platform

D8: Program type already present: android.support.v4.os.ResultReceiver$1
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

35 actionable tasks: 35 executed
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
  Program type already present: android.support.v4.os.ResultReceiver$1
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

* 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 47s
C:\***\apa\platforms\android\gradlew: Command failed with exit code 1 Error output:
Note: C:\***\apa\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
D8: Program type already present: android.support.v4.os.ResultReceiver$1

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
  Program type already present: android.support.v4.os.ResultReceiver$1
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

Ionic info:

Ionic:

   Ionic CLI                     : 5.0.3 
   Ionic Framework               : @ionic/angular 4.5.0
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.3.0

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 3.1.2, (and 6 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : 0.2.6

System:

   Android SDK Tools : 26.1.1
   NodeJS            : v11.10.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.7.0
   OS                : Windows 10

Posts: 1

Participants: 1

Read full topic


Storing mp3 file in app's file system, in Ionic v4, and reading and playing them

$
0
0

@VictorNorman wrote:

I am trying to do something which I feel should not be too difficult: download mp3 files, store them “locally”, and then make them available for a user to play. But, wow, I am really having problems…

I am successfully downloading the mp3 files from Firestore – at least as far as I can tell. And, I feel like I’m storing them in the “Data” directory – certainly it seems like they are there when I run my app in a browser, and use the debugging console to see the storage system. See image below.

However, I’ve been unable to figure out how to read the 1.mp3 file in from that location and play it, either with an html <audio> tag or using Javascript Audio stuff or with cordova media stuff. The errors that come back usually so are obscure that you cannot tell if you are not reading the file correctly or have saved the file in a bad format or have not been able to find the file in the file system.

Can anyone help me? Do you have any suggestions on how to tell if the file is in a good format and/or how to read the (binary) file in and play it?

(Note: here are all the things I have been able to do successfully:

  1. Play an audio file that is stored in assets.
  2. Download json files from the web and store then in the Data directory.
  3. Read json files in from the Data directory and process them.
    )

Frustratedly yours,

Vic

Posts: 1

Participants: 1

Read full topic

App windows 10 with Ionic3 - net::ERR_CONNECTION_REFUSED

$
0
0

@jardprog wrote:

Hi!,I have an Ionic 3 application desktop for windows 10, and in my computer i installed the desktop app that i have a local service too in port 8080. The problem is when I try to conect with the localservice… windows app response is “Status 0 for URL: null”. Just work when the service is in other computer. I have inactive the firewall in windows. Can any one help me please?

Posts: 1

Participants: 1

Read full topic

Ionic4 passing angular commands through ionic and cordova

Ionic tabs authentication guard JWT ADAL token

$
0
0

@Maestropikal wrote:

Hi all,

my students and I are working on implementing SSO login with ADAL and JWT on an ionic tabbed application.

We use another Ionic application which already implements SSO JWT and ADAL as reference for this, witch uses AuthGuard injectable service implementing canActivate function, this module being imported by the route module, itself imported by the app.module.ts (quite classical construction).

But my question is now for our tabbed application : it uses a tabs component, with ion-tab marks in the html file to navigate from one page to another.

I would like to protect this navigation but I read it is not a very correct design. My point is that I don’t want the user to keep being logged and free to navigate, if his token is timed out / deprecated.

I’m sorry if this is a dumb question but I m a noob in ionic development :slight_smile:

Thanks forward for your answers

Posts: 1

Participants: 1

Read full topic

Should I use virtual scroll for a changing data set

$
0
0

@Stubbsy345 wrote:

Hi,

So I have a list of items that can be very long, and the user is able to search over these items. This means the length of my array changes depending on how many items are returned from the users search.

The list can sometimes be very long so would like to use virtual scroll to optimise performance. However, I know that changing data in virtual scroll is a very expensive task, so was wondering if this is a false economy and if anybody has a better solution. Or is it okay to use virtual scroll in this instance.

Thanks.

Posts: 1

Participants: 1

Read full topic

Viewing all 70434 articles
Browse latest View live