I'm trying to set up automatic updates on my Safari extension and it doesn't seem to be working. Here is what I have tried so far.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Extension Updates</key>
<array>
<dict>
<key>CFBundleIdentifier</key>
<string>com.COMPANY_NAME.safari.EXTENSION_NAME</string>
<key>Developer Identifier</key>
<string>MY_IDENTIFIER</string>
<key>CFBundleVersion</key>
<string>4</string>
<key>CFBundleShortVersionString</key>
<string>4</string>
<key>URL</key>
<string>PATH_TO_EXTENSION_DOWNLOAD</string>
</dict>
</array>
</dict>
</plist>
From my understanding whenever someone who has downloaded the extension opens Safari with my extension installed it will ping the "Update Manifest URL" set in the extension builder. If the versions do not match the extension at the download URL then an update will be made.
The .plist file is on my server and the extension is being served from the server with the "Update Manifest URL" set correctly. I can download the extension from my website but when I upload a new extension version and update the plist file I'm not getting prompted to update my extension in Safari > preferences > extensions.
Is there anything potentially missing in what I've been doing?
Try setting the date on your computer a day or to into the future. I think Safari only checks for updates once a day. Or did you already solve this?
I would try hitting your 'Update Manifest' URL directly and ensure that the file it's calling is indeed a greater version than the current extension you have. If that checks out fine then your current version of the extension might not have an update manifest URL set so your update file isn't being called at all!
In this case you need to either figure out what update manifest URL the current version is pointing at and upload your update.plist file there and continuously do that upon every release incase users from v1.0 (with update issues) are coming back when v3.0 is out using the new update url they need a way to break their dependency on that old update manifest url...or require that new users install your updated version directly from the server with the proper update manifest URL field set as well as the update.plist you posted above.
As a test I would install the latest version of the extension from your server, turn off auto update in safari preferences so you'll be notified if there's a new version, then bump the versions to 4.0.1 or something minor and upload the new files to the server. Then restart safari and see if anything triggers inside the safari extension preferences.
I have verified the communication to update server with Wireshark. Seems that Safari would check updates.plist (the one specified in the extension Info.plist as
<key>Update Manifest URL</key>
<string>URL/updates.plist</string>
) anytime you visit Preferences -> Extensions -> Updates. If the server responds with 304 Not Modified, Safari does no further action. If the plist contains a newer version of the extension (and it's the only version in the plist), Safari downloads and updates the extension.
Related
I am using Ti.Platform.canOpenURL() to open another app which worked fine before iOS 10.
But it doesn't work on iOS 10 and later.
How to solve this?
You use Ti.Platform.canOpenURL('<my-url>') to check for the URL. To open the URL, you need to use Ti.Platform.openURL('<my-url>') instead.
With some of the new security features of iOS9, SDK 5.1.2's canOpenUrl might fail without adding in the proper properties in the info.plist file.
Therefore, you need to add the following key into the tiapp.xml file:
<ios>
<plist>
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>[Your Project Name]</string>
<string>[Your Second Project Name (if any)]</string>
</array>
</dict>
</plist>
</ios>
Hope this helps.
Cheers.
OK, guys... So, I need your help.
I've been desperately trying to upload my latest app to the App Store and (after various, unrelated error messages) I'm now getting the following:
Error ITMS-90135: The executable could not be re-signed for submission
to the App Store. The app may have been built or signed with
non-compliant or pre-release tools
Here's what:
My app uses Node.js (with several pre-"installed" Node modules, along with Node itself, all located in the Executables folder of my app bundle).
Now, I have codesigned all of those binaries and libraries (as reported by earlier error messages) with the appropriate(?) entitlements:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>
And this is the command I used:
codesign -f -s "$CERTIFICATE" --entitlements "$ENTITLEMENTS" "${ROOT}$EXEC"
Any idea what might be going on here?
I am trying to configure my app to support push notification, but keep getting this error:
Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x1f818fc0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
I did enable my app to support push notifications (only for development at this point).
I did create the provisioning profile AFTER enabling the push notifications.
My bundle identifier is the same as appears in the profile.
In my profile file there is a string: aps-environment
I made sure that in both project and target under the "Code signing identity" section ALL the values are selected to be my provisioning profile.
Any more ideas? Thanks.
In my case, the stuff in my provisioning profile:
security cms -D -i ~/Downloads/spolskyDevelop.mobileprovision
...
<key>application-identifier</key>
<string>P5GM95Q9VV.com.dca.spolsky</string>
<key>aps-environment</key>
<string>development</string>
Was different than the stuff in the app that was actually built (you can find out where it is built by looking at Xcode's Logs tab)
codesign -d --entitlements - '/Users/drew/Library/Developer/Xcode/DerivedData/spolsky-bdbtdfjeeywhqzccpmmceqvnhgtm/Build/Products/Debug-iphoneos/spolsky-ios.app'
<dict>
<key>application-identifier</key>
<string>Y2X6Z7Z2GR.com.dca.spolsky-ios</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>Y2X6Z7Z2GR.com.dca.spolsky-ios</string>
</array>
</dict>
This was true even though the "Currently Matches" hint text under Code Signing Identity was indicating the correct provisioning profile--weird, huh? To make a weird story weirder, the correct provisioning profile was being installed on the device when I ran, (Settings->General->Profiles) leading me to believe the provisioning profile was right--but it was falling back to a wildcard ID when the app was actually launched.
The clue was the difference in the output of these two commands:
Y2X6Z7Z2GR.com.dca.spolsky-ios vs P5GM95Q9VV.com.dca.spolsky
When I made the bolded part match, the italicized part changed to match automatically. In addition, the output of security and codesign were in agreement, and no more aps-entitlement error.
My guess here is that XCode was using a wildcard-style match on my non-wildcard ID. ("spolsky" is, after all, quite nearly "spolsky-ios"), and this explains the "Currently Matches" output. But something in the build chain is more strict about this, so it falls back to an actual wildcard ID during the build.
The problem is due to current Provisioning Profile does not contain APNS information, as the Provisioning Profile is created BEFORE creating the APNS certificate.
Therefore, to solve the problem, create a new Provisioning Profile & select the Provisioning Profile in Xcode will clear the error.
I had this same problem after push notifications were already working on my device. Seemed like Xcode cached something incorrectly so refreshing it fixed my problem:
Xcode -> Preferences -> Accounts
View Details for your Developer Account
Just click Refresh for the Provision Profiles a few times. I was seeing these change with each refresh. Keep refreshing until they stop changing.
i got this error and did not create a new provisioning profile; created a new one and then had to restart xCode but works now!
Be aware that the bundle identifier must match the provisioning profile in a case-sensitive manner. I had something like com.FirstLast.appname when it should have been com.firstlast.appname. Well, that kept me busy for quite a while.
I fixed this problem by enabling push notification capability.
Select Project > Target > Capabilities > Turn On Push notifications
If this problem happened suddenly after upgrading to Xcode 8 you might find a warning in the capabilities screen that'll allow you to fix this automatically:
Select Project > Target > Capabilities > Turn On Push notifications
Product->Clean did it for me. Hopefully it does it for someone else.
I ran into this in what's possibly a non-frequent use case. I'm working with Xcode 6 and iOS 8. I was creating a series of entirely new app projects, and attempting to re-use the same bundle ID, so as not to need to go through all of the portal-side setup again. This too was just for sandbox testing.
I would find that, while the setup and registration would work fine for the first app, if I deleted that app from the device, set the same bundle ID for the second app, and then attempted to register PNs with that app, I would get this error.
My solution was to:
Remove the associated provisioning profile from the device.
Remove the associated provisioning profile from Xcode.
Close Xcode
Double-click my downloaded .mobileprovision file to install it back into Xcode
Open the project and deploy it.
This approach seems to jar loose whatever previous state was there, and I'm able to register for PNs with the new app / same bundle ID.
For those who got this error in ios 10, you can try following steps:
1.clean your project.
2.and check Targets -> Capabilities -> Push Notification.If it is off,On it.
And problem will solve.The above steps help me to get rid off this problem. Hope it will helpful to someone.
New provisioning profile worked for me. Make sure to use a Developer profile if you are in development (don't use Ad Hoc). It was fine after that, no idea why the old one stopped working right.
I've done the edit on the SDKSettings.plist. did the don't code sign thing and I can build the project. it installs perfectly on my jailbroken device (with no error); but when I wanna run it, it jumps out of the app immediately! (crash at runtime)
I've installed the same app with the same file on another iPod Touch running iOS 5.0 and it works perfectly. so the problem seems to be with the 5.1.1 version. (iGuess)
I have NO IDEA how to make this work.
any ideas?
The answer is to use JailCoder.
I've been all up and down this problem and I think I have your solution. Yes, you have to have a minimal level of fake code signing if you want to deploy and debug from Xcode 4.3. Turn code signing back on in Xcode and follow the basic instructions here. Don't worry about the -gta code signing flag and use the following for your ldid3.py script (the other one won't work at all):
!/usr/bin/python
from sys import argv
from subprocess import call, check_call
from os.path import basename, splitext, join
from tempfile import NamedTemporaryFile
app = argv[-1]
obj_path = join(app, splitext(basename(app))[0])
with NamedTemporaryFile() as f:
f.write("""
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>get-task-allow</key>
<true/>
</dict>
</plist>\n""")
f.flush()
check_call(['/usr/local/bin/ldid', '-S' + f.name, obj_path])
I didn't have to do the tdmtanf step, but that may be because I have appsync installed.
I am sorry for posting so many questions, but getting this to work has been incredibly painful, even tho Testflight makes it much easier
Invalid IPA error: The APS environment in your embedded.mobileprovision and your binary don't match
I figure this has got to do with my Apple Push Notifications. I am using my distribution profile across all my settings. My app has been configured to both development and production.
What could the causes of this error be?
As a side note, I have been working on this for the entire day, and I get stuck at one thing after the other, esp involving static libraries and xcode4. Am I really bad at this, or does Apple really make it so hard?
I think it was an xcode bug. Here's how i solved it, and maybe it can be useful for some users in the future. Including my problem solving steps for reference:
i changed the entitlement file to aps-environment = production. No go, still different between the 2 files.
i changed ALL my settings (debug/not) to the distribution profile, just to be sure
I built it again, and checked out the embedded.mob and binary as you suggested
No go again.
I went nuclear - deleted all my profiles, downloaded only the distribution build i needed
here is when it became interesting - i could not build it on debug (expected), but i was having the same problem of "profile not found" even when i was in ad hoc archiving mode. Surely that means that there remains a reference to the developer mode even when i was trying to archive it (given that i have already changed ALL my settings and deleted all my other profiles)
So i digged up project.pbxproj, and found the offending line that was still trying to access my development profile in ad hoc build. I changed it manually, and bingo, things worked as per expected
End of the day, i am surprised why this would happen. It seems like an xcode 4 bug. Normally it is my fault when these things happen, but this seems arcane enough (plus i had so much trouble with xcode 4 for a few other things).
Solved with help from the amazing Testflight team!
http://support.testflightapp.com/discussions/tools/17-invalid-ipa-the-aps-environment-in-your-embeddedmobileprovision-and-your-binary-dont-match
Also, particularly if the target you're archiving was based on another target, double check that your target's "Archive" Scheme is based on the correct Build Configuration of Build Settings.
In Xcode 4.2 next to the run menu, click on -> Edit
Scheme
Click on the 'Archive' button in the left drawer
Look at 'Build Configuration
For Testflight, I replicate my Release Build Configuration, and rename it 'Ad Hoc' for just this purpose, specifying my Ad Hoc provisioning profile and whatever else needs to be in there. If you've gotten this far, I presume you've already done that, but for posterity, I figured I'd mention it.
I ran across this error before as well, so follow these instructions for this to work:
Create a provisioning profile for your app and add the devices to it of the people who should test it.
Build your application using that provisioning profile you just created and export it as an *ipa.
Upload it to TestFlight and select the devices that you want to test the app on.
Many people miss step 2, (so did I) and that's essential for it to work. So give it a try! :)
Replying this question, in case someone bumps onto this while uploading an air mobile app.
Make SURE you check the Entitlements element in your app.xml.
<iPhone>
<InfoAdditions>
<![CDATA[
<key>UIDeviceFamily</key>
<array>
<!-- iPhone and iPod touch devices -->
<string>1</string>
<!-- iPad devices -->
<string>2</string>
</array>
]]>
</InfoAdditions>
<!-- This part below.. -->
<Entitlements>
<![CDATA[
]]>
</Entitlements>
My Entitlements looked like this back when I got the error:
<Entitlements>
<![CDATA[
<key>application-identifier</key>
<string>QFY9MVY9K8.com.somethingHere.anAppName</string>
<key>aps-environment</key>
<string>development</string>
]]>
</Entitlements>
This is how it looks now:
<Entitlements>
<![CDATA[
<key>get-task-allow</key>
<false/>
]]>
</Entitlements>
This error was caused because
I used a DIFFERENT ID in the <key>application-identifier</key> than the one in my provisioning profile.
I used development key instead of production in the <key>aps-environment</key> part.