Yesterday for unknown reason my ionic deploy was no longer working, I always had some “unexpected token” written in red in my cmd when I launched the command ionic upload --deploy (never happened before)
I read online that to solve this I could regenerate another ionic.project by emptying the “app_id” value (“app_id”: “”)
This worked, the ionic -upload --deploy was now pushing the update to https://apps.ionic.io.
However, I can no longer fetch that update from my project!
I tried removing and readding the platform, rebuilding, putting back my old value in ionic.project, nothing works anymore, I just get "Ionic Deploy: no updates available " from the console log when I try to fetch it…
Here is the code to fetch that update (always worked before)
Is the app trying to fetch the update for the same app_id?
(Use a proxy like Charles Web Proxy to check which URL the deploy.update call on the device is fetching)
My current theory on your problems: There are multiple places where app_id are placed, and probably you missed one (or better: deleting it from ionic.project wasn’t enough).
My theory is the same as yours, but shouldn’t removing platform and readding fix this already?
I even went to the ionic.io.bundle.min.js to make sure it was the correct app_id added, and it was.
Also, maybe it’s not connected, but I feel like my bower.json is out of date, I can see in it some old versions for my plugins and even some plugin that I already deleted. Maybe it’s calling the wrong ionic-service-core & deploy? How can I update its content?
I will make sure it’s fetching from the same app_id with the proxy you mentionned…
I am trying to use charles web proxy, I connected it to my android device, I can see http://apps.ionic.io listed on the left when I check for an update, but where am I supposed to see if it’s calling the right app_id?
The “request” tab in charles is showing me only unreadable characters…
Absolutely, but before you go there better find out if you are really requesting updates for the correct ID. Best way to figure out where to continue.
Ah, Deploy is using SSL: Right click on the request and set “SSL Proxying”. If this doesn’t work instantly, google for how to capture SSL requests using Charles. There are lots of SF posts about this. (I am on an old version of Charles, so I can’t really give you instructions on how to set this up - but shouldn’t be too hard).
I added apps.ionic.io to my SSL proxy settings, but now when I start a request it “blinks” on the structure tab but disappears right away.
I don’t have time to catch its content, it doesn’t stick around like it does when I remove that SSL proxying… weird.
EDIT: Okay I got it, I had to add the charles certificate on my android phone to get it working.
So I can now say that yes, it is calling the right app_id…
Yes, it is indeed an awesome tool. It even helped me realize that an app I was using was connecting to my email address using my password not encrypted… I could see it in the header of the request. Thank you for that.
Anyway, I call doUpdate() in my Appctrl which wraps the whole app (it’s the controller of my sidemenu)
So I can go to another view and go back to the first one, it will work.
The only problem is the view when I just launched my app.
Do I need to call the doUpdate() on device ready or something?
[quote=“pierro, post:13, topic:37669”]
Do I need to call the doUpdate() on device ready or something?
[/quote] Yes, as it uses the deploy plugin to do the request to the ionic.io backend servers, waiting for device ready seems like a good idea:
That’s an interesting point, is$ionicPlatform.ready(function() {...} doint exactly the same as document.addEventListener("deviceready", function () {…}) ?
Because I have in my app.js the second one INSIDE the ionicplatform.ready… Would that be useless?