I am creating multiple versions of an app using product flavors. Each app version has a different application id suffix.
Is there any way to generate Here Android SDK Premium app id and key using the android app package name without the suffixes from the product flavors or are separate credentials required for each flavor?
You need separate credentials for each of the product flavours. You have to provide your build variant values using the SDK method (instead of hardcoding in manifest file). Please refer the documentation in https://developer.here.com/documentation/android-premium/api_reference_java/com/here/android/mpa/common/ApplicationContext.html#ApplicationContext-android.content.Context-
Related
I'm trying to setup multiple environments for my Vue / Firebase Project.
I have two Firebase Projects
1.) Dev
2.) Prod
The project utilizes Stripe Extension which pulls the API Key from an auto-generated file called:
firestore-stripe-payments.env
which contains:
STRIPE_API_KEY=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_API_KEY-xxxx/versions/latest
Where xxxx is a random 4 character string.
That line pulls the value of the key from Google Secret Manager.
Let's say Dev is 'dddd'
and Prod is: 'pppp'
The issue is that I can only define either:
firestore-stripe-payments-STRIPE_API_KEY-dddd
or
firestore-stripe-payments-STRIPE_API_KEY-pppp
At first I tried to create a new value within Google Secret Manager simply called:
firestore-stripe-payments-STRIPE_API_KEY
The thought was this should be a simple fix, and it would pull the associated API_KEY for the project currently being used.
but this causes the error:
Error: firestore-stripe-payments: Found 'projects/foo/secrets/firestore-stripe-payments-STRIPE_API_KEY/versions/latest' for secret param STRIPE_API_KEY, but this instance was previously using a different secret projects/fooo/secrets/firestore-stripe-payments-STRIPE_API_KEY-dddd.
Changing secrets is not supported. If you want to change the value of this secret, use a new version of projects/foo/secrets/firestore-stripe-payments-STRIPE_API_KEY-dddd.You can create a new version at https://console.cloud.google.com/security/secret-manager?project=fooo
Also, if there is a better place to ask this question please let me know, couldn't find the 'right' room
For this scenario, could you include a separate env (env.dev) file using the following guidelines
.env # loaded in all cases
.env.local # loaded in all cases, ignored by git
.env.[mode] # only loaded in specified mode
.env.[mode].local
For generating separate keys for each environment, I believe from your example you are using a single Stripe Extension on a single project.
Firebase Extensions can support multiple instances of an Extension per project, this will create a separate "dev" secret for you to use.
Additionally, a separate Firebase project with another "Stripe Extension" installation would be recommended to separate any concerns in development.
Recently I had to change the package name of my android project because I had to disable an old app to change some pieces of information and some of the UI of it. But the business logic are pretty the same. So I wonder, can I use the same solution with a different package name for Android (for create another app in google play with the same name but different package name) and then keep the bundle id the same for iOS to not have to recreate another one in the app store? Will I have problems with it?
Thanks very much.
In my knowledge, there should not be any issues if you make sure about the following pointers:
Everything that was registered on the old bundle id is now registered for the new one and replaced with the new one all over your project. eg: if you have a firebase product used then you replace the old googleservices.json with the new one.
The old app that you have on the store is removed(To avoid confusion for users)
You can use the same key to sign the key but you cannot use the same App that you added on store earlier.
Make sure you do not have any dependency of any sort on the old bundle id.
Note: Your old app will not be replaced by this new one even though they would have the same name as the bundle id is the unique identifier for this.
There should not be any problems if you use the same bundle id for the new iOS app as you had earlier but usually, both apps have the same bundle just to keep it standard. But you can always opt. not to.
Goodluck feel free to get back if you have any more queries
I am trying to figure out how to set up different firebase environments in a flutter project.
I understand how to do this in firebase, I created two projects, one for production, one for the test. Then, in an iOS or Android project, I could use various methods to switch between these two environments using separate google-services.json or GoogleServices-Info.plist files.
In Flutter I found this description of how to separate environments, but it only explains how to differentiate between environments in the flutter code.
How can I get this environment to change what iOS and Android build at compile time? It would even be sufficient simply to allow a file copy hook at build time.
You can switch accounts using FirebaseApp.configure. You can offer your own solution or secret dev panel to switch between them.
The solutions will build flavours and plist implementations will lock you into builds when you deploy for TestFlight + they are messy.
Here's an example: (You could use Assets as well.)
// Load a named file.
let filePath = Bundle.main.path(forResource: "MyGoogleService", ofType: "plist")
guard let fileopts = FirebaseOptions(contentsOfFile: filePath!)
else { assert(false, "Couldn't load config file") }
FirebaseApp.configure(options: fileopts)
I wrote an article about how to do this for Firebase configuration as well as runtime configuration in dart code using flavors and platform channels.
https://medium.com/#matt.goodson.business/separating-build-environment-configurations-in-flutter-with-firebase-doing-it-the-right-way-c72c3ad3621f
Flutter flavors work pretty seamlessly with Android flavors. For iOS you need to create Xcode schemes for each flavor and link them to build configurations.
For dart configuration, you can use platform channels to get the flavor used during the build at runtime. This lets you configure the app without having multiple main.dart files or passing a target argument.
Salvatore Giordano has written a blog post with a detailed description of how to achieve this:
https://medium.com/#salvatoregiordanoo/flavoring-flutter-392aaa875f36
Flutter accepts a parameter --flavor=<flavor> which allows you to select different build flavors. In Android this works as expected, selecting different build flavors. IOS is a little tricker because a scheme is needed for every flavor, and the build configurations in the form of Release-<flavor> are also needed.
Once these parts are in place, they can be used, to select the firebase configuration as you would in any iOS or Android project.
The challenge is getting Dart code to also be aware of the flavor, and the blog post provides no good solution for this. It suggests the standard method of using different entry points can be used, but the correct entry point must be matched to the correct flavor manually by the person invoking the app.
Specifically to Firebase env config you can use this article and this article from CodeMagic which explains how you can set up plist files with build env variables.
If you need to have a different set of values inside your Dart code, like an option you can use this package. It allows to generate Dart class config file from console command params.
Update 12/05/2020
Since Flutter 1.17 you can actually use compile-time variables with --dart-define argument in flutter run and flutter build commands
Here is an article that describes how to specify and use them.
With the release of Flutter for Web to the stable channel, I put together instructions for targeting multiple firebase projects (e.g. dev, staging, prod) from multiple build platforms (i.e. iOS, Android, and Web).
I have a live app in the Xamarin UWP store and I have implemented the trial and a paid version which is working fine. Now I want to publish a new update of the app after I converted from PCL to.Net Standard 2.0. when I build, I get the certificate error and it asks me to enter the password for the certificate I uploaded to the server.
It doesn't accept my password. I am pretty sure that I enter a correct password. I don't know the reason. So my questions are;
Does certificate play any role in LicenseInformation? I am basically checking if it is trial or not with the code below. If I create a new certificate, will that cause any effect on existing purchases?
I tried with the new certificate using local CurrentAppSimulator, all works fine but although I re-associated to store app, I get exception using CurrentApp as below. Is it because of I am using different certificate than in the store? So if I provide a new submission with a new certificate, the problem will be solved?
System.ExceptionException from HRESULT: 0x803F6107 Raw at
Windows.ApplicationModel.Store.CurrentApp.get_LicenseInformation()
#if !DEBUG
licenseInformation = CurrentApp.LicenseInformation;
#else
licenseInformation = CurrentAppSimulator.LicenseInformation;
#endif
licenseInformation.LicenseChanged +=LicenseInformation_LicenseChanged;
if (licenseInformation.IsActive)
{
if (licenseInformation.IsTrial)
{
Now I want to publish a new update of the app after I converted from PCL to .Net Standard 2.0.
If you switch to the latest .NET Standard 2.0, you'd better use the Windows.Services.Store namespace relevant APIs instead. The Windows.ApplicationModel.Store Namespace document has explained clearly.
The Windows.ApplicationModel.Store namespace is no longer being updated with new features. If your project targets Windows 10 Anniversary Edition (10.0; Build 14393) or a later release in Visual Studio (that is, you are targeting Windows 10, version 1607, or later), we recommend that you use the Windows.Services.Store namespace instead. For more information, see In-app purchases and trials. The Windows.ApplicationModel.Store namespace is not supported in Windows desktop applications that use the Desktop Bridge or in apps or games that use a development sandbox in Dev Center (for example, this is the case for any game that integrates with Xbox Live). These products must use the Windows.Services.Store namespace to implement in-app purchases and trials.
I have an Xamarin Android (and maybe someday iOS) app that utilizes a rather sizable SQLite database (20MB+). I am somewhat new to mobile app development and definitely to Xamarin. I need to control database versioning. This is a best-practice question.
Edit/Clarification: Some of the data is app/user created or maintained. Some of the data is generated via a 3rd party and is read only, in 2nd and 3rd normal form. That data must be updated with version release. Also, the user will purchase some of these data sets in-app.
My Plan:
Everytime the app opens - OnStart (), I will validate the version of the database that is supposed to exist via a configuration string against a table value in the SQLite database with version info. If the versions don't match, the database file will be copied from the APK/assets to a local folder on the device, overwriting the existing file. I definitely don't want this to happen everytime the app opens for many reasons.
3-part question:
First, is this solution a solid approach without major road blocks? Where in Xamarin (or Android project) is best to store the database version string? And finally, is there a 3rd party library (preferably nuget) which already handles database versioning? I cannot find anything like that for .NET / Xamarin. Only some Java libraries which are more Android specific.