NativeScript / nativescript-app-sync

♻️ Update your app without going through the app store!
MIT License
125 stars 24 forks source link

[iOS] Not getting any updates #29

Closed manijak closed 5 years ago

manijak commented 5 years ago

I'm having a hard time in getting any updates in my iOS app even tho the logs state that the updated has been applied. This is what I did:

1) Installed the app-sync-cli & app-sync plugin. configured appsync in my app.ts in the application.resumeEvent. 2) Added deployment keys for each platform, sat installMode to ON_NEXT_RESTART\ON_NEXT_RESUME 3) Configured the updateDialog & Added syncStatus logs. 4) Build the app, and ran it on my iPhone Xs Max running iOS 12.4 5) The logs state No pending updates; you’re running the latest version. Good. 6) I made a small change in one of my views and ran a new build. 7) Published a release with appsync nativescript-app-sync release myAppIOS ios --d Production 8) The website doesn't show any releases, but the cli does. Label V1. Good. 9) Used the app a bit, closed it, opened it again. This time log states: Update found and installed. It will be activated upon next cold reboot. (No update dialog showed up...) 10) Checked the view I modified, no update applied. 11) Closed the app, restarted it again, log states: No pending updates; you’re running the latest version 12) Checked the view I modified, no update applied.

What am I missing here? Is there a debug mode or something in particular I should look for? Do all builds have to be release-builds?

NS 6.0.2 ios-platform: 6.0.1 core-modules: 6.0.4 app-sync: 1.0.4

manijak commented 5 years ago

UPDATE: False alert :) I did some cleanup in my main.ts. I had sveral instances listening to the application.resumeEvent. Cleaned everything up so that there is just one of each event in the file.

Ran the build, got the update, restarted the app. And the update is applied! Awesome 👍 ! This even worked on the ios simulator.

From my understanding, the updateDialog is only available on Android (installMode.IMMEDIATE).

EddyVerbruggen commented 5 years ago

Good job!

The immediate dialog is also possible on iOS, but if your app is reviewed by Apple make sure you don’t show it as afaik they don’t allow apps to bother users with update dialogs.

manijak commented 5 years ago

Yeah I figured that out :) Do have a separate view where I show app-info like version & buildnr. Will add the updateLabel there as well. 👍

So if dialogs are a no-no, what about the "toast" notifications? Like in the nativescript-feedback plugin?

EddyVerbruggen commented 5 years ago

AFAIK they don't want you to prompt the user to restart the app.

andreMariano90 commented 4 years ago

@manijak , how did you solve it? I'm having the exact same problem. iOS informs that the appSync was instaled but it wasnt. I made somehow it work in the simulator only 1 time. Now it doesnt work in the simulator and in the real device as well

manijak commented 4 years ago

@andreMariano90 honestly my app.ts file was a bit messy, I had events all over the place and some of them doubled up. So I just cleaned up everything there making sure I just hook to the application-events only once, including the resumeEvent:

on(resumeEvent, () => {
    AppSync.sync({ ... }
    }, (syncStatus: SyncStatus, updateLabel?: string) => { ... }
    });
});
andreMariano90 commented 4 years ago

Doing the same here. Probably because I'm running it on Vue, I cant figure out any other alternative. My last atempt was running it on the Home.vue calling only once. @EddyVerbruggen , do you intend on developing a demo for ns-vue? It shouldnt be a problem right? In Android it works perfectly

ShobhitJain3040 commented 4 years ago

I am also getting same issue in device both android and iOS while the in simulator it is working fine. @manijak I have cleared all the resumeEvent listeners but still not able to resolve this issue.

andreMariano90 commented 4 years ago

After a long time I discovered what happened.

There is a before-prepare that checks if the ios folder exists. https://github.com/NativeScript/nativescript-app-sync/blob/master/src/scripts/ios/appsync-ios.js

Sometimes this folder was not created yet, then you will see this log: "iOS not installed, skipping AppSync hook."

To fix this issue, You must build it twice without removing the plataforms folder.

I know its a workaround, probably changing when triggering this event would work.