iOS and push notifications-does not work in Xcode environment - ios

I'm not sure that title is clear. What's happening is that I have been working on the Push Notifications feature for my enterprise app. It has been working fine in the development environment, but I have migrated to the distribution version, and it works fine on the iPhone if the app is downloaded from the archived .IPA file on the server, but not if it is running from the directly installed version from Xcode. (i.e. through the iPhone connected to the Mac via USB.) And even if I stop the test run, disconnect from the Mac, and run the app as it is installed directly from Xcode, PNs do not come through. It's only if I reinstall the app from the server. Very strange.
I have all certificates properly created and installed, which shouldn't matter, I'd think.
Anyone have a clue why it's like this?
Thanks!
EDIT: Additional info: Same problem if I load it either way on the iPad. OK if downloaded, not if directly installed.
Edit 2: I figured it out. See my answer below.

Well, it was sorta stupid on my part. Turns out the version installed onto the phone from Xcode is by default a development version, and I was using the distribution server configuration. Duh.

Related

Xcode 11.1 not installing new build with changes (iOS 13.1.2)

After installing 11.1 I created a new project, removed the multi-window stuff that Xcode now gives you by default, and started developing a test app that uses Vision Framework.
By the time I got to the point where I needed to test on the device instead of the simulator, I was struggling to make my app work correctly. I finally realized that running the app on my phone required me to delete the app and run a fresh install or the changes wouldn't be pushed to the device. This continues to be a problem. Even a new print statement won't be shown in the debugger output unless I go through the rigamarole of deleting the app and running fresh. Subsequent changes still use the initially installed build regardless of the number of times I clean/build/run.
I've cleaned the project, build folder, derived data, Xcode cache, rebooted my Mac, rebooted my phone, reinstalled Xcode, obliterated and reinstalled Xcode again, all with no success.
Anyone else with this issue? What am I missing?!
Ok, after two days of trying to fix this, it turns out to be some kind of Apple bug on iOS 13 (surprise, surprise).
Here's what I did/found:
I tried running on another device and was able to see changes on subsequent runs.
Back on the original test device, the issue still exists (Xcode issue ruled out)
I had a couple other test apps that were signed with the same development cert on the device, so I deleted those too.
Running the app from Xcode again prompted me to go to settings to trust the developer certificate
Changes and updates are now pushed to the device on each run from Xcode.
TLDR:
If you happen to run into a similar issue, try deleting other development certificate apps you have on your device and re-trust the certificate.

Cannot install Apple Enterprise application

I have an Enterprise app that until recently has been installing and working fine. Recently, I've been trying to install it but I am unable to do so. At first I thought it was the new rule that you needed to have two-factor authentication in the developer account. But I added the authentication and I still can't install.
What happens when installing is, it shows a progress bar that says "Loading". Then at some point it says "Installing", but almost immediately after it says "Installing" the progress bar disappears and the icon goes dark. Sometimes it shows a message saying that the app couldn't be installed and gives the option of retrying or done.
Furthermore, the app DOES install in some devices. I have confirmed that it installs on three devices, which is weird enough. I have no idea what could be causing this. If anyone can shed some light on this I will be forever grateful as I am losing my mind over this. I should add that the app was made in Ionic Framework and, like I said at the beginning, everything has been working perfectly until now.
EDIT: Another interesting point is that I tried running the app from XCode directly to my iPad and it is installing perfectly. It is only when I download it from my Enterprise link that it fails, and only on certain devices so far.
As per your question What I understand that you are running app from xcode and it runs on certain devices, but if you prepare a build it won't install in iOS devices right?
If it is right then follow these steps, may be this will sort issue for you.
If you run the app directly from xcode use development profile in code signing.
If you prepare build for enterprise edition use distribution profile and prepare the build. When you preparing build via archive then using option distribution, select the enterprise mode for preparing the build. may be this will sort your issue.
Before doing this, clean the project.
** I am considering that you have all the updated certificates, profiles and account.

Unable to install the iOS application

I have tested the application on many devices, it's working fine, but i am getting a weird error while installing the same app in iPhone 8(iOS 12.1).
Refer the screenshot for better reference:
I tried restarted the iPhone as well as the mac system, but nothing seems to be working.
just quit the simulator and clean your project then build and re-run your app in that if you do not have a physical device.
But if you have a physical device please reboot your iPhone and then clean project and re-run your project as above.
Hope it will work fine for you...! thank you
This was a provisioning profile issue as i was trying to install the application without registering the device. Once i registered the device, it starts working fine.

"Unable to Download App", but can install through Xcode

I have a Xamarin.iOS app which is available to download from our company enterprise store. Upon trying to download and install this app on iOS versions 8.2 and 9.3, it gets about 2/3 of the way complete then gives the error message, "Unable to Download App, AppName could not be downloaded at this time.".
The app downloads and installs fine on iOS 11.4 fine. (These are the only devices I have available to test).
I'm able to download other apps which are hosted on this store, so it's not a connectivity or firewall issue.
Since it installs fine on 11.4, it doesn't seem like an issue with the provisioning profile.
I can download on Mac the IPA file which is hosted, and can install this on all the devices through Xcode and it works fine.
Rebooting devices, cleaning the solutions and re-publishing have not worked, and despite connecting devices to the Console there doesn't seem to be any error message thrown.
Any help would be very much appreciated!
I finally found the issue. Clicking on the link in the enterprise store would point to a plist file which would then point to the download package. In the plist file, there was also a reference to the app icon which had a different file name. This meant that on lower versions of iOS it would look for that icon but would not find it. But when directly installing the IPA through Xcode, it didn't use that plist file so would download and install fine.
I don't know why this only affected lower versions of iOS, but in searching for a solution I must have filtered some relevent results out by using those search terms. Thankfully, a whole 3 weeks later and it's finally sorted!

iOS App Crashes when installed remote/diawi but not if installed from xcode

I have an iOS app which, when submitted to Apple is crashing during usage when you try to go to a new view. This also occurs if i package up the application for enterprise distribution and then go to use the app.
If i just plug the phone in and run from xcode to the device though, it runs perfectly.
Has anyone experienced this before and have any ideas what it could be? Running latest xcode and ios, not using betas.
EDIT - i've tested building straight to the device using both debug and release scehemes, and they both working, but again, only when the device is plugged into the computer and it's built straight to it. packaging it in anyway and installing remotely causes it to crash on a particular screen. The error logs end up as a basically unreadable mess at this point.
When we archive app it mostly builds with release mode on, and when we run build on devices simply by XCode it's with debug mode on. You can check these configuration by going
Edit Scheme -> Run -> Build configuration, same you can check for Archive.
Now for tracking the crash issue you can simply try changing Run's debug mode to release mode for time being.
I got the crash where I was doing configuration for firebase for production target which has different bundle identifier than dev build identifier. You case may be different.
Wow, to be honest, that is really odd... It really shouldn't have that affect if you distribute via enterprise... As of any idea on how to fix this issue: you did add entitlements to the app when signing via enterprise, right?

Resources