That’s very possible due to how Live Reload works. Try swapping onMounted
with ionViewWillEnter
or ionViewDidEnter
.
Ionic vue running on device , the login work successfully but when it directed me to the dashboard , it didn't get the data from api and the user details
Ionic vue running on device , the login work successfully but when it directed me to the dashboard , it didn't get the data from api and the user details
Ionic vue running on device , the login work successfully but when it directed me to the dashboard , it didn't get the data from api and the user details
Seems like you need to fix that origin issue then. That looks like a custom response from your backend as a standard CORS error doesn’t return a response.
Badge enhancement for tabs
I want to propose an enhancement to tabs that would allow the use of badges to tabs for use in the ion-tabs component. One use case would be to show the count of new items in an ‘Inbox’ tab.
An example of 3 new properties for a tab:
showBadge: boolean
badgeValue: number
badgeColor: color
This enhancement would be rally helpful in providing a context for users that would guide them to look at a particular tab when there is something new.
AddListener to plugin never triggers
(post deleted by author)
AddListener to plugin never triggers
It’s custom code in my project, not a npm installed plugin
I’m registering my code like this:
let actionPlugin = actionPlugin()
bridge?.registerPluginInstance(actionPlugin)
And the handleAction
function is being called by a button in the iOS app ( I haven’t added the code for that as I didn’t think it relevant, but I have confirmed that the handleAction
is being triggered and is triggering the enclosed notifyListeners
function too)
FCM push notifications app badge
We’ve just updated our Firebase Admin SDK on our app backend and there is no longer an option to add a badge count for the app icon badge. Also noticed that the capawesome badge plugin that we have been using is now deprecated.
Does anyone know how to set an app icon badge for iOS now?
Ionic foreground and background - store state of application
To test what happens when the OS kills your app in the background, on Android you can try this:
- Enable developer mode on Android
- Turn on the “Don’t keep activities” setting
Now anytime you background the app, the OS will kill the activity.
Or if you launch a different activity in your app, for example Camera activity, then when you return to your app, the app will restart.
Taylor Swift Joins Chiefs Kingdom, Confirmed?
Taylor Swift’s membership in the ‘Chiefs Kingdom ‘ has been officially confirmed or it is jut a rumor’s around?
Ionic renders old routes that returned a when state changes
With the useUser() hook, you might try wrapping the logIn()
and logOut()
functions in useCallback()
; not using useCallback()
can also generate rerenders in some circumstances. All these hooks inside hooks in React really annoyed me, which is why I rebuilt my app with react-query.
Here’s my logout function:
const postLogout = async (
platform: Platform,
localStoragePreferences: LocalStoragePreferences,
noLogoutUrlCall?: boolean,
): Promise<boolean> => {
if (noLogoutUrlCall === true) {
return Promise.resolve(true);
}
await removeCookiesOnMobile(platform);
// Do not await this because awaiting will not log out properly on the PWA.
return invalidateDrupalSession(localStoragePreferences)
.then(() => Promise.resolve(true))
.catch((error: unknown) => Promise.reject(catchDrupalError(error)));
};
When the session is invalidated, a custom hook reloads the generic user object with react-query.
In my case the pages stay in the DOM as expected.
It occurs to me that one way to work around this is to remove all the logged in history when logging out using window.location.reload()
; it’s not elegant, but reloading the window will reset the history and so pages definfitely won’t reappear.
Badge enhancement for tabs
You can propose features to Ionic framework on Issues · ionic-team/ionic-framework · GitHub
AddListener to plugin never triggers
Where are you putting the registration code?
FCM push notifications app badge
As far as I know the capawesome badge plugin is not deprecated, it was just moved to GitHub - capawesome-team/capacitor-plugins: ⚡️ Community plugins for Capacitor. Supports Android, iOS and the Web. and the old repository was archived because of that.
For push notifications the badge number should be sent from the server, so I think you should report the issue to Firebase, they should allow you to set the badge from there.
Badge enhancement for tabs
That is a good idea! You can make it work now too though. Right now I just show a dot when there are new community messages. But a number should work too.
<IonTabButton tab="community" href="/tabs/community">
<IonIcon src="/assets/icons/tab-community.svg" />
<IonBadge
v-if="showCommunityMessageDot"
class="rounded-full border border-primary-contrast p-0 leading-[0]"
color="white"
>
<IonIcon class="text-xs text-red-default" :icon="ellipse" />
</IonBadge>
<IonLabel>Community</IonLabel>
</IonTabButton>
ion-badge.md {
top: theme('spacing.[1.5]');
}
ion-badge.ios {
top: theme('spacing.[0.5]');
}
Sorry not sorry for the TailwindCSS
Badge enhancement for tabs
Sounds like i posted this in the wrong place. I will post in github.
Capacitor sync cb.apply is not a function
Have upgraded to Capacitor 6. Using Nx for monorepo management. Had to switch from @nxtend/capacitor
to @nxext/capacitor
for Cap Cli integration. Using Yarn for package management cli on a Windows machine.
Unable to get past cb.apply error (command output below). From what I have read online clearing npm cache fixes the issue. Since I’m not using npm did a yarn cache clean.
I also cloned my repo fresh into a new directory and built node_modules fresh.
> nx run touch-controller:sync:android
> yarn
warning package.json: No license field
warning touch-controller: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @capacitor-community/wifi@0.0.1" has incorrect peer dependency "@capacitor/core@^3.2.0".
warning " > usb-serial-plugin@0.0.9" has incorrect peer dependency "@capacitor/core@^4.6.1".
[4/4] Building fresh packages...
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sdunning\AppData\Roaming\npm-cache\_logs\2024-06-19T18_11_49_130Z-debug.log
Install for [ '@capacitor/cli@6.1.0' ] failed with code 1
Running Capacitor apps from WSL on Windows Android Studio
Similar problem, maybe a slightly different scenario. I’m opening Android Studio pointing to the WSL file location and can’t seem to get past a Gradle config issue.
Invalid Gradle JDK configuration found.
Use Embedded JDK (C:\Program Files\Android\Android Studio1\jbr)
Change Gradle JDK location
Capacitor sync cb.apply is not a function
Sounds like a node issue your having. Its hard to give the proper help without proper description of your issue. How do I ask a good question? - Help Center - Stack Overflow. with that being said heres a solution you can try:
node.js - npm ERR! cb.apply is not a function - Stack Overflow. There are several solutions in this thread, including a windows.
Capacitor sync cb.apply is not a function
Yes I agree that it’s a Node issue. Suspect my Node version manager nodist is getting in the way. I think capacitor cli uses npm under the hood but have not peeked at the source for it to understand what sync(copy + update) is doing.
Capacitor sync cb.apply is not a function
Yeah that was the issue. Uninstalled nodist and installed a clean version of NodeJs which got me past this problem. On to solving other gradle build issues now.