iOS Fastlane deployment (TestFlight) - how to include BETA demo credentials? - testflight

We’re starting to use Fastlane for automated deployment, and it’s a very impressive toolset.
One mystery, though:
When submitting a BETA build to Apple’s TestFlight, how do you pass in the Demo Account credentials (username and password)? The docs don’t seem to say.
There seem to be a couple of clues here:
https://github.com/fastlane/fastlane/blob/master/spaceship/lib/spaceship/test_flight/beta_review_info.rb
https://github.com/fastlane/fastlane/blob/master/spaceship/spec/test_flight/app_test_info_spec.rb
And there does seem to be a way to pass in this info for actual App Store submissions:
https://github.com/fastlane/fastlane/blob/master/deliver/Deliverfile.md [see app_review_information]
... but not for TestFlight betas.
How do you do the equivalent for BETA uploads?
Thank you very much!

You need to use Appfile, pilot use it like deliver
Here is the doc.
https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
My Appfile for ex. is:
app_identifier ENV["app_identifierEnterprise"] # The bundle identifier of your app
apple_id ENV["accountAppleId"] # Your Apple email address
team_name ENV["teamNameEnterprise"]
team_id ENV["teamIdEnterprise"]
for_platform :ios do
for_lane :releaseBeta do
app_identifier ENV["app_identifier"]
apple_id ENV["accountAppleId"]
team_name ENV["teamName"]
team_id ENV["teamId"]
end
end
I use .env (a file to set this variables), but you just need to replace ENV[""] with "ValueYouWant"
Hope this helps.

Related

Need to tell users when update occurs

I want to notify all the app users to update the app (through a popup in the app itself) whenever there is a new version deployed in the stores. Can someone suggest the best way to do that?
Luckily, we do have solution for iOS app store
string url = "http://itunes.apple.com/lookup?bundleId=com.xxx.xxxxx";
HttpClient httpClient = new HttpClient();
Task<string> jsonString = httpClient.GetStringAsync(string.Format(
var lookup = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString.Result);
But Now I need to get the current version of App from Google Play Store?
Let's say you want to notify the users about a new version of the app every time they open the application, then you should just trigger a simple GET call to retrieve the latest version info or use a third party lib to act accordingly.
0 cost simple solutions
One option would be to ask the API (if there is any) if a new version is available - basically delegate the problem to someone else. If there is no backend the app could do the check itself. There are different options from having a simple txt file hosted somewhere with the latest app version to scraping App Store and Play Store for the current published version of the app.
Existing solutions
https://appgrades.io/
https://github.com/ArtSabintsev/Siren
Use Push Notifications to notify your users
You will find more if you google it
Platform specific solutions
For iStuff (Apple) you could use iTunes Search API as mentioned here
Other platforms may have their own APIs
Depends on the specific case you can decide what will work better for you.
P.S.: Be sure to handle the versioning correctly by bumping the app version on each release.

Do I need a separate provision profile for qlgenerator (Quick Look Plugin)?

My app comes with a quick look plugin.
Currently I'm signing it with the same provision profile as the main app.
Do I need to have separate bundle id and provision profiles for my qlgenerator ?
I've published my app on App Store with a separate provision profile and bundle id for the qlgenerator. It passed the review and seems to work just fine.
So I guess the correct answer is "Yes, you need to have a bundle id and prov.profile for the quick look plugin"

Access parse current user from Apple Watch

I am making an application for the Apple Watch.
I successfully linked my watch extension to parse. However, I can't access parse data stored on the phone.(In my case PFUser.currentuser() )
What would be the best way to get my current user?
Parse SDK 1.7.2 is out right now and I feel this is exactly what you are looking for.
It brings full support for sharing data with App Extensions and Apple Watch Apps.
Read more in this blog post http://blog.parse.com/announcements/introducing-local-data-sharing-for-apple-watch-and-app-extensions/
Or in the docs on how to set it up: https://parse.com/docs/ios_guide#extensions/iOS

Bundle Identifier mismatch in iTunes Connect

My App is named 'This & That'. Well, that's not my App's real name. 'This' and 'That' stand in for the two actual words I'm using.
In Xcode > Targets > General > Identity > Bundle Identifier shows:
com.domain.This---That
So, it looks like Xcode replaced the two spaces and the ampersand in my App name with hyphens in order to generate a bundle ID it liked.
Over in iTunes Connect under App Information > Identifiers, the Bundle ID shows:
'This---That'
I think that's wrong. This was due to a misunderstanding on my part when I entered the data. I believe I should have entered 'com.domain.This---That'
I discovered this issue when I made an Archive of my App in the Organizer and submitted it for Validation.
The Validation failed with one fault and I got the following back:
"The bundle identifier cannot be changed from the current value, 'This---That'. If you want to change your bundle identifier, you will need to create a new application in iTunes Connect."
Maybe I'm being too literal here but when it says,
"...you will need to create a new application in iTunes Connect."
it seems to me that before I can do that, I will need to delete the application I have in iTunes Connect now (the one with the wrong bundle ID).
I read about how to delete an App in iTunes Connect and says that if I do that, I cannot reuse the SKU or the App name in the same organization.
That could be a real problem for me because I really like the App name I have now. The two words I've chosen work really well for what I'm doing. So if I can avoid it, I do not want to do anything here to fix my problem that will preclude me from using the App name I've chosen.
Any suggestions on how I might sort this problem out?

Determine if device token is sandbox or distribution

Is there a way to determine if a device token is sandbox or distribution? We are testing and the application is sometimes signed with a development certificate and others are signed with an ad hoc certificate(distribution certificate). This is because we are passing the application around to some of the 100 provided ad hoc test devices, and also building development signed apps to our devices.
Because sending a push notification requires that we select the appropriate push server and pem file, it would be great to be able to determine if the token is sandbox or distribution to send the notifications in the appropriate way so that the push notification succeeds.
We must sometimes use the distribution profile to sign our applications, so testing the push notification system requires us to deliver these notifications properly.
Open project build setting
Go to preprocessing settings
Under "Preprocessor macros not used in precompiled headers" (assuming you are not branching code in a .pch file), add TOKEN_ENV_SANDBOX=0 under Release and TOKEN_ENV_SANDBOX=1 under Debug and Ad Hoc.
In your code wherever just use the compiler directive
#if !TOKEN_ENV_SANDBOX
NSLog(#"TOKEN_ENV==PRODUCTION");
#endif
#if TOKEN_ENV_SANDBOX
NSLog(#"TOKEN_ENV==SANDBOX");
#endif
EDIT:
Corrected an issue above.
Here is what Apple has to say
You can determine in Xcode which environment you are in by the selection of a code-signing identity. If you see an “iPhone Developer: Firstname Lastname” certificate/provisioning profile pair, you are in the sandbox environment. If you see an “iPhone Distribution: Companyname” certificate/provisioning profile pair, you are in the production environment.
Add an Preprocessor Macro to your Target's Build Settings under Apple LLVM 7.0 - Preprocessing. Then under Debug add something like:
isRunningInDevModeWithDevProfile=1
Then in your .pch, you can do something like this:
// AZ - 01282016 - Determine which environment we are running in for APNS
# ifdef isRunningInDevModeWithDevProfile
# define isAPNSSandbox YES
#else
# define isAPNSSandbox NO
#endif
And then where you need to check it in your code, you can do this:
NSString *ifAppIsRunningFromXcodeUsingNonReleaseProfile;
if (isAPNSSandbox) {
ifAppIsRunningFromXcodeUsingNonReleaseProfile = #"dev";
} else {
ifAppIsRunningFromXcodeUsingNonReleaseProfile = #"prod";
}
We pass this value back to our APNS server so that it knows which path to take when calling Apple's APNS.
The reason I suggest this is that in this case, if you leave the preprocessor macro undefined in the non Debug targets, this will not cause an error when you try to build it.
Sure, there are solutions with a better form, but this is is a rather safe and quick way to get this functionality up and running.
I read all answers above and they are all correct but do not answer the basic question: "Is device token sandbox or distribution?".
It is because they detect build configuration, not token quality.
After spending several days in resolving this issue, I got to the straigt-forward solution:
Test token you got with real Apple Push Notification Server. You may use simple app that will talk to the server and you just need to configure it.
I did use this simple app "Easy APNs Provider" for macOS or any else.
https://itunes.apple.com/us/app/easy-apns-provider-push-notification/id989622350?mt=12
My core issue in macOS app was that I keep getting production token in both Debug and Release configurations.
When you detect what was an issue, you may invalidate certificates to be 100% sure it will not be compromised.

Resources