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

Problem with BLE read and notify HELP!

$
0
0

I have a BLE setup with Arduino and Ionic Cordova, and using the cordova-ble-central-plugin.

it will read good when I use read, but when I put notify command it will not show anymore.
please help me!
here is my sample code:

this.ble.startNotification(this.peripheral.id, BLE_SERVICE, BLE_CHARACTERISTIC)
.subscribe(
data => {
// this.ngZone.run(() => {
//console.log(data);
this.onTemperatureChange(data);
// });
}

);

this.ble.read(this.peripheral.id, BLE_SERVICE, BLE_CHARACTERISTIC)
// .then(
.then(
data => {
console.log(data);
this.onTemperatureChange(data);
},
() =>
this.showAlert(“Unexpected Error”,“Failed to subscribe for changes, please try to re-connect.”)
);

}

onTemperatureChange(buffer:ArrayBuffer) {

var data = new Uint8Array(buffer);
console.log(data[0]);

this.ngZone.run(() => {
this.temperature = data[0];
});

}

1 post - 1 participant

Read full topic


When will Appflow support Ionic Portals?

$
0
0

Hi,

We have a client interested in Ionic Portals + Appflow for live updates. When will Appflow support Ionic Portals? Is there a timeline? Thanks a lot!

1 post - 1 participant

Read full topic

Toggling header & footer on tap

$
0
0

I searched quite a bit but couldn’t find how to toggle header & footer on tap similar to this iBooks or any other ‘reader’ app:

ezgif-7-e99984d81c

I imagine it could be done with CSS trickery but I want to neatly hide and show them with fade or slide animation.

I’d appreciate any help. Thanks.

2 posts - 2 participants

Read full topic

Scheduling repeating local notifications for multiple days of the week

$
0
0

Hi,
I am using capacitor v3 local-notifications, and I need to allow scheduling notifications on particular multiple days of the week (e.g. every Saturday and Sunday each week) or multiple days of the month.

The configuration here Capacitor - build cross platform apps with the web seems to only allow 1 day per week for weekly, or 1 day per month for monthly.

For now, I can only see creating multiple scheduled notifications as a workaround (e.g. one weekly notification per each day of the week).

Is there any other, more correct way to configure repeating notifications like this?

Thanks!

1 post - 1 participant

Read full topic

Disable vibration on ion-reorder

$
0
0

Hey!

I’m currently working on my first app and got a reorder group wich works fine. The app also is now on my smartphone and i noticed, that it vibrates, whenever I reorder items in my reorder-group every time the item passes another item in the group.

Is there a way to deactivate that vibration? Maybe even globally for the whole app?

I tried it with awesome-cordova-plugins/vibration, capacitor/haptics and ionic-native/vibration, but did not manage it.

Would appreciate your help!

Cheers,
Nico

1 post - 1 participant

Read full topic

Do modals need defined routes?

$
0
0

I was curious about everyone’s opinion when it comes to routing and modals.

Does your modal need a route if it is never accessed through a traditional route in your app, rather through the Modal Controller?

If you do not load it through a route, is the best practice just to include the module in the modals parent module file?

1 post - 1 participant

Read full topic

Webpack compilation error (mobile app with tabs)

$
0
0

Whenever I compile my mobile app with tabs I get this error:
ERROR in Conflict: Multiple assets emit different content to the same filename index.html
[vue-cli-service] webpack compiled with 1 error

The app works but it’s annoying… How can I solve it?

1 post - 1 participant

Read full topic

Is it possible to encrypt/decrypt Ionic Angular Storage?

$
0
0

I am building an app where I store information from a JSON API using @ionic/angular-storage. Some of the data is somewhat sensitive (i.e. I don’t want people to steal it) and I wondered if there was a free way to encrypt/decrypt the data when saved?

I’m aware of the Ionic Secure Storage offering but the price is completely disproportionate for my requirements.

Any help or directions appreciated.

1 post - 1 participant

Read full topic


Capacitor Keyboard is pushing content up when height is set to 100%

$
0
0

I have a login page that I set the height to 100% and use flexbox to center in the page.

When I click on my inputs for the login page, the keyboard pushes the content up on the page.

If I remove the height, the issue does not happen. Is there a way to get the Keyboard to just overlay on the content and not push it up?

1 post - 1 participant

Read full topic

Nested is appending instead of replacing

$
0
0

For some reason I do not understand the content of every route the user navigates to gets appended to the nested ion-router-outlet, however, when I reload the page the component loaded is the one that matches the URL.

I have tabs working in my local with ion-router-outlet working as expected, however, I’m not able to figure out why in this other case isn’t working as expected. Any help?

1 post - 1 participant

Read full topic

Cdk Virtual Scroll

$
0
0

I’m working with Ionic 6 with Angular and Capacito3

As I scroll down the list, there are shots, where the elements suddenly slide upwards.
In my opinion, the problem occurs every few pixels that correspond to the value set in maxBuffer, in fact the lower the maxBuffer, the more it appears, but having a high maxBuffer means slowing down the application.

Do you know if there is a solution?

My HTML CODE:

<cdk-virtual-scroll-viewport itemSize="{{itemSize}}" 
                                 minBufferPx="{{itemSize * 5}}"
                                 maxBufferPx="{{itemSize * 10}}">

         <!-- Here I have some components that need to scroll, 
                 like a slider and buttons -->


        <ion-card *cdkVirtualFor="let deal of deals"
                  style="padding-top: 0px; margin-top: 0px;">
                <!-- Here I have content item -->
        </ion-card>

</cdk-virtual-scroll-viewport>

1 post - 1 participant

Read full topic

Ionic cordova android platform won't add

$
0
0

I am having a nightmare as always with npm packages and ionic / cordova. I run:

ionic cordova platform add android

And i get this error:

Cannot overwrite directory
‘/Volumes/Work/Projects/green-water-services/platforms/android/app/src/main’
with non-directory
‘/Volumes/Work/Projects/green-water-services/plugins/cordova-plugin-firebase/src/android/google-services.json’.

I have no idea what it’s doing! Here is my package:

{
  "name": "green-water-services",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^11.2.14",
    "@angular/core": "^11.2.14",
    "@angular/fire": "^6.1.5",
    "@angular/forms": "^11.2.14",
    "@angular/platform-browser": "^11.2.14",
    "@angular/platform-browser-dynamic": "^11.2.14",
    "@angular/router": "^11.2.14",
    "@ionic-native/ble": "^5.6.11",
    "@ionic-native/bluetooth-serial": "^5.6.11",
    "@ionic-native/camera": "^5.6.11",
    "@ionic-native/core": "^5.6.11",
    "@ionic-native/firebase": "^5.6.11",
    "@ionic/angular": "^5.6.11",
    "@ionic/app-scripts": "^3.2.4",
    "cordova-plugin-bluetooth-serial": "^0.4.7",
    "firebase": "^8.6.8",
    "ionic": "^5.4.16",
    "ionicons": "^5.5.2",
    "npm": "^8.3.0",
    "rxjs": "~6.6.0",
    "rxjs-compat": "^6.6.7",
    "signature_pad": "^4.0.1",
    "tslib": "^2.3.0",
    "typescript": "4.1.6",
    "zone.js": "^0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^12.1.0",
    "@angular-eslint/builder": "2.0.2",
    "@angular-eslint/eslint-plugin": "2.0.2",
    "@angular-eslint/eslint-plugin-template": "2.0.2",
    "@angular-eslint/template-parser": "2.0.2",
    "@angular/cli": "11.2.14",
    "@angular/compiler": "^11.2.14",
    "@angular/compiler-cli": "^11.2.14",
    "@angular/language-service": "^11.2.14",
    "@ionic/angular-toolkit": "^3.1.1",
    "@types/jasmine": "^3.7.7",
    "@types/jasminewd2": "^2.0.9",
    "@types/node": "^12.20.15",
    "@typescript-eslint/eslint-plugin": "4.16.1",
    "@typescript-eslint/parser": "4.16.1",
    "cordova-android": "^10.1.1",
    "cordova-plugin-ble-central": "^1.3.1",
    "cordova-plugin-camera": "^5.0.2",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-firebase": "^2.0.5",
    "cordova-plugin-firebase-lib": "^5.1.1",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.2.1",
    "cordova-plugin-splashscreen": "^5.0.4",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.5",
    "eslint": "^7.29.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "firebase-tools": "^9.14.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "^6.3.4",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.6.0",
    "postcss": "^8.4.5",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-bluetooth-serial": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-ble-central": {
        "ACCESS_BACKGROUND_LOCATION": "false"
      },
      "cordova-plugin-firebase": {},
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      }
    },
    "platforms": []
  }
}

Output of ng version is:

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.14
@angular-devkit/build-angular   12.2.14
@angular-devkit/core            12.2.14
@angular-devkit/schematics      11.2.14
@angular/fire                   6.1.5
@schematics/angular             11.2.14
@schematics/update              0.1102.14
rxjs                            6.6.7
typescript                      4.1.6

It works fine when serving or running to a device, but as soon as i try to build it errors happen all over. Does anyone have any idea what is going on?

1 post - 1 participant

Read full topic

React Ionic and Google Firebase auth errors when using ios mobile application

$
0
0

Hi All,
I am currently having some issues trying to integrate Google Firebase authentication into a React Ionic mobile application. So far I have been able to set up the app to run correctly on both web and android but am running into repeated issues with IOS. The code runs correctly for Firebase auth login on android does not seem to be running on IOS.

The initial call to “signInWithEmailAndPassword” seems to work fine and returns “auth/multi-factor-auth-required” but any time I try to make a call to “verifyPhoneNumber” on ios I will receive the response of “Firebase: An internal AuthError has occurred. (auth/internal-error)”, there are no further details provided.

//Firebase setup in seperate file with code like these 2 lines 
app.initializeApp(config);
const firebaseAuth = app.auth();
//

firebaseAuth
.signInWithEmailAndPassword(email, password)
.then(function (user) {
        //other code
})
.catch(function (error) {
        if (error.code === "auth/multi-factor-auth-required") {
            let resolver = error.resolver;
            setTimeout(() => {
                dispatch(phoneAuth(appVerifier, resolver));
            }, 2000);
      } else {
          //other code
      }
});

var phoneInfoOptions = {
    var phoneInfoOptions = {
      multiFactorHint: resolver.hints[0],
      session: resolver.session,
    };
    var phoneAuthProvider = new firebase.PhoneAuthProvider();
    phoneAuthProvider
      .verifyPhoneNumber(phoneInfoOptions, appVerifier)
      .then(function (verificationId) {
        console.log("verify Id recieved");
      })
      .catch((error) => {
        console.log(error);
      });

Things I have checked/tried so far are:
followed all steps in firebase docs
Setup ios app in firebase console and followed the steps listed

Has anyone run into issues like this previously and has any advice on what I could check next?

Thanks

1 post - 1 participant

Read full topic

Stencil: Jest 27 Upgrade Instructions

$
0
0

Originally published at: Stencil: Jest 27 Upgrade Instructions - Ionic Blog

Stencil v2.13.0 includes support for Jest v27, but does not require any project to upgrade their version of Jest at this time. You can upgrade Stencil and continue to use any previous version of Jest that you currently have in your workflow with no breaking changes. For folks who wish to upgrade to both Stencil…

1 post - 1 participant

Read full topic

WifiWizard 2 ERROR_ADDING_NETWORK

$
0
0

Hello,

I need some help. I try to develop an app which is setting up the wifi connection on an android device.
I try to use WifiWizard2 with this.wifiWizard2.connect(ssid, bindAll, password, algorithm, isHiddenSSID) but when i try the app on an Device (Android 12) i only get the Error: ERROR_ADDING_NETWORK.

Here is the code I use, i hope you can help me:

import { Component } from '@angular/core';


declare var WifiWizard2: any;


@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
  
})
export class HomePage {
  ssid = "ubntPOS";
  password = "6545A-UAPACL";
  info_txt = "";

  async getNetworks() {
    this.info_txt = "loading...";
    try {
      await WifiWizard2.timeout(4000);
      await WifiWizard2.connect(this.ssid,true,this.password,'WEP',false);
      this.info_txt = "";
    } catch (error) {
      this.info_txt = error;
    }
  }
}

For example:

WifiWizard2.scan();

does work properly and list all networks nearby.

Thank you!

1 post - 1 participant

Read full topic


Announcing Stencil v2.13

$
0
0

Originally published at: Announcing Stencil v2.13 - Ionic Blog

The first Stencil minor release of 2022 is here, and it’s a big one. With the release of Stencil v2.13, Stencil now includes support for Jest 27! Jest sits at the core of Stencil testing, so we’ve been working hard to ensure that Stencil continues to support the latest version of Jest. This has been…

1 post - 1 participant

Read full topic

On click ion button ionic 6.18.1 vue

$
0
0

Hi, this is my code.

<template>
  <ion-page>
    <ion-header translucent>
      <ion-toolbar>
        <ion-title>Blank</ion-title>
      </ion-toolbar>
    </ion-header>
    
    <ion-content fullscreen>
      <ion-header collapse="condense">
        <ion-toolbar>
          <ion-title size="large">Blank</ion-title>
        </ion-toolbar>
      </ion-header>
    
      <div id="container">
        <ion-button shape="round" color="primary">Test</ion-button>

      </div>
    </ion-content>
  </ion-page>
</template>

<script lang="ts">
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonButton } from '@ionic/vue';
import { defineComponent } from 'vue';

export default defineComponent({
  components: {
    IonContent,
    IonHeader,
    IonPage,
    IonTitle,
    IonToolbar,
    IonButton
  }
});
</script>

<style scoped>
#container {
  text-align: center;
  
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

#container strong {
  font-size: 20px;
  line-height: 26px;
}

#container p {
  font-size: 16px;
  line-height: 22px;
  
  color: #8c8c8c;
  
  margin: 0;
}

#container a {
  text-decoration: none;
}
</style>

How i can call a function on the ion button click? I searched online but all the reply are for the old version.
Sorry for my english.

1 post - 1 participant

Read full topic

Cannot read property 'classList' of undefined - Tabs issue

$
0
0

I’ve seen a lot of posts about this in Github but nothing seems to be the same issue for me / resolving it. My gut says we’ve done something wrong in our routes but can’t seem to spot it. Here’s our routes definitions:

const routes: Array<RouteRecordRaw> = [
    {
      path: "/",
      redirect: "/login",
    },
    {
      path: "/login",
      name: "Login",
      component: Login,
    },
    {
      path: "/tabs/",
      component: Tabs,
      children: [
        {
          path: "feed/",
          name: "Feed",
          component: Feed,
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "help",
          name: "Help",
          component: () => import("@/views/Help.vue"),
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "profile",
          name: "Profile",
          component: () => import("@/views/Settings.vue"),
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "profile/text-size",
          name: "TextSize",
          component: () => import("@/views/SettingTextSize.vue"),
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "profile/scroll-speed",
          name: "ScrollSpeed",
          component: () => import("@/views/SettingScrollSpeed.vue"),
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "feed/blog/slug-:slug",
          name: "View Blog No ID",
          component: () => import("@/views/ViewBlog.vue"),
          beforeEnter: async (to, from, next) => {
            const result = await contentApi.get(`/industries/1/content/slug-${to.params.slug}`);
            next({
              name: "View Blog",
              params: {
                contentId: result.data.content.id,
              }
            });
          },
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "feed/blog/:contentId",
          name: "View Blog",
          component: () => import("@/views/ViewBlog.vue"),
          meta: {
            requiresLogin: true,
          },
        },
        {
          path: "feed/videos/:contentId",
          name: "View Video",
          component: () => import("@/views/ViewVideo.vue"),
          meta: {
            requiresLogin: true,
            requiresFeatures: ["pro"],
          },
        },
        {
          path: "feed/script/:contentId",
          name: "View Script",
          component: () => import("@/views/ViewScript.vue"),
          meta: {
            requiresLogin: true,
          },
          beforeEnter: async (to, from, next) => {
              /** reset script store data to make sure previous script doesn't show */
              store.dispatch("scriptStore/reset");
              next();
          }
        },
      ],
    },
    {
      path: "/rt/:scriptId",
      name: "RT",
      component: () => import("@/views/RTHome.vue"),
      meta: {
        requiresLogin: true,
      },
    },
    {
      path: "/rt/:scriptId/rehearse",
      name: "RT Rehearse",
      component: () => import("@/views/TeleprompterPage.vue"),
      meta: {
        requiresLogin: true,
      },
    },
    {
      path: "/rt/:scriptId/record",
      name: "RT Record",
      component: () => import("@/views/TeleprompterPage.vue"),
      meta: {
        requiresLogin: true,
      },
    },
    {
      path: "/rt/:scriptId/customize",
      name: "Customize Script",
      component: () => import("@/views/CustomizeScript.vue"),
      props: true,
      meta: {
        requiresLogin: true,
      },
    },
    {
      path: "/paywall",
      name: "Paywall",
      component: () => import("@/views/Paywall.vue"),
      props: true,
      meta: {
        requiresLogin: true,
      },
    },
    {
      path: "/rt/:scriptId/preview/:filePath",
      name: "Preview Video",
      component: () => import("@/views/RTPreview.vue"),
      props: true,
      meta: {
        requiresLogin: true,
      }
    }
  ];

Our app has a home view with 3 tabs. One of the tabs is a list of content, when you view a piece of content it stays within the tab view as a child page. There’s also a handful of pages that should show without the tab view.

If I open the app, navigate to ANY second page within the tabbed parent view, then to a view without the tabs, then go back to a view with tabs. I get the “TypeError: Cannot read property ‘classList’ of undefined”… Here’s the example chain of pages I’m navigating through to cause the error:

/tabs/feed
/tabs/feed/blog/3853
(BACK) /tabs/feed
/tabs/feed/script/3818
/rt/3818
(BACK) /tabs/feed/script/3818 -- breaks before this page loads, cannot read property 'classlist' of undefined

And here’s the error:

index.esm.js?d867:884 Uncaught (in promise) TypeError: Cannot read property 'classList' of undefined
    at isViewVisible (index.esm.js?d867:884)
    at handlePageTransition (index.esm.js?d867:1083)
    at setupViewItem (index.esm.js?d867:1173)
    at eval (index.esm.js?d867:941)
    at callWithErrorHandling (runtime-core.esm-bundler.js?5c40:155)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?5c40:164)
    at Array.job (runtime-core.esm-bundler.js?5c40:1779)
    at flushPreFlushCbs (runtime-core.esm-bundler.js?5c40:328)
    at flushJobs (runtime-core.esm-bundler.js?5c40:369)

Changing to use createWebHashHistory or createMemoryHistory does not help. All of the pages involved have an element and have the IonPage component registered.

We’re using ionic-native/core 5.36.0, ionic/vue 5.9.3, and ionic/vue-router 5.9.3… I’m at a total loss for what to do

1 post - 1 participant

Read full topic

Why the button inside the modal not working in Ionic?

$
0
0

I have created an ionic app. In the followig code, I have created a popover which some contents from json. When button clicked in popover it opens a modal which contain a button with onclick function.

But the function does not get called. I have tried same with two modal but still not working?

let courseNumber = 0;

interface ContainerProps {
  courseNum: number,
  onHide: () => void,
}


const PopoverList: React.FC<ContainerProps> = ({ courseNum, onHide }) => {
  const [showTopicModal, setShowTopicModal] = useState(false);

  return (
    <><IonToolbar>
      <IonTitle size="large">{courseJson[courseNumber]['title']}</IonTitle>
    </IonToolbar><IonContent>
        {courseJson[courseNumber]["content"].map((item) => <IonItemDivider key={item.toString()}>
          <IonLabel>{item}</IonLabel>
        </IonItemDivider>
        )}
      </IonContent>

      <IonButton slot='bottom' size='default' color="success" expand='block' onClick={() => setShowTopicModal(true)}>Learn</IonButton>

      <IonModal isOpen={showTopicModal} id="topic_modal">
        <IonButton slot='bottom' size='default' color="success" expand='block' onClick={() => console.log("hello")}>Learn</IonButton>
      </IonModal>
    </>
  )
}

1 post - 1 participant

Read full topic

Automation Error to Google Play

$
0
0

We are getting this error when we attempt to automate sending our aab to Google Play after a successful build.

[!] Google Api Error: Invalid request - Changes cannot be sent for review automatically. Please set the query parameter changesNotSentForReview to true.

We don’t have a fastlane script, and we are unclear how we would use one within appflow. It’s our understanding that we have to set a “changes_not_sent_for_review” flag to “true”, but it’s unclear to us how to do this.

1 post - 1 participant

Read full topic

Viewing all 70909 articles
Browse latest View live


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