Where is the version specified in Ionic app? - ionic-framework

I'm using AppVersion.getVersionNumber() to get the version number of my Ionic app. But where does this number come from?
The problem is that when I run the app on a smartphone through devapp, I get a different version number depending on what OS I have…
iOS (on an iPhone 6): 1.0.2
Android (on a Samsung S10): 1.0.4
Searching around for "version" in my source code, I find this in config.xml (in the root):
<widget version="1.0.3" … >
I don't know if this is relevant, but it is the currently delivered version of the app.
I'm using Ionic 4.10.0

AppVersion cordova plugin reads the app details from the native code of the application.
So the version values that you see, are configured in the native IDE's.
Check these files in your respective platform folders..
ios/App/App.xcodeproj/project.pbxproj the key to look for in this MARKETING_VERSION
android/app/build.gradle the key to look for in this versionName

Related

Ionic - Angular with Capacitor on Android : All app updates must use Billing Library version 4 or newer. in-app-purchase-2

Version used: "#awesome-cordova-plugins/in-app-purchase-2": "^5.46.0",
Actions on Webstorm (ionic project) :
ionic build
npx cap sync
npx cap open android
Actions on Android Studio:
Generate a signed bundle
Actions on google play console:
Create new release with the signed bundle
Warning on google play :
We've detected that this app is using an old version of Google Play Billing. By November 1, 2022, all app updates must use Billing Library version 4 or newer. Update to Billing Library 4 before this date.
What I tried without success:
Add these two lines in the build.graddle:app and in capacitor.build.graddle and in the capacitor-cordova-android-plugins/build.graddle:
dependencies {
....
implementation "com.android.billingclient:billing:5.0.0"
}
What I want:
How do I update the PlayBillingLibrary from ionic and have it be taken into account with Capacitor when i sync my app on android (npx cap sync) ?
Thanks in advance
You need to update cordova-plugin-purchase to version 11.0.0 or higher (see RELEASE_NOTES.md).

Is there a way to check if a particular flutter plugin will work with a particular Android/IOS operating version?

I'd like to know if there is a way to determine if a flutter plugin will operate on a particular Android or IOS operating version?
For example would a flutter plugin like:
https://pub.dev/packages/http/
Work on android version 6 and older?
I expect that it would be dependent on the version of the plugin I'm intending to use.
Is there an easy way to check this?
You can view build.gralde file for check minimum Android version and plugin_name.podspec file (where plugin_name is name of the plugin) for minimum iOS requirements. Many plugins on pub.dev contains links to its source code (on GitHub or etc.)).
build.gradle contains in android folder, and you need to find line like this:
defaultConfig {
minSdkVersion 21
}
plugin_name.podspec file contains in ios folder, you need to find like this:
s.platform = :ios, '9.0'
Config files also contains more information about what version of Language plugin using.

how to ensure my flutter application is compatible with android 4.1?

i would like to make possible to install and use my flutter application on a phone which has a android OS version 4.1, but when i run my code on a simulator the result is :
i cannot open the app no matter how many times i try it.
and my api and sdk versions are : minSdkVersion 16 targetSdkVersion 29
is my api version the problem? play store says about this the minimum OS compatible is 4.1 but it does not work

Can my Flutter project have a different version number for Android and iOS?

Is it possible to use pubspec and the flutter build tools to create release versions of my app with a different version for each platform? Eg iOS could be 1.0.1+10 and Android 5.2.3?
This is wrong but I'm thinking something like like the below
name: myapp
description: my app description
ios_version: 1.0.1+10
android_version: 5.2.3
Currently the apps in the stores have different version numbers. Would we need to bump them both to the same version, say 6.0.0? Is it possible to have a pubspec for each version?
For iOS find the file name Generated.xcconfig and change the following parameter
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
Otherwise, default version getting from pubspec.yaml from the following line :
version: 1.0.0+1 // default version set
For Andriod edit the local.properties file inside android folder when you are building.
For iOS edit the Generated.xcconfig file inside ios/FLutter folder or update from Xcode when you are building.
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1

Ionic Native with console log from ionic cordova run ios -c

I have searched all over to get this answer but nothing works.
I am building an iPad app in Ionic 2 that uses various native plugins.
I want to be able to test the native features and observe the console logs but nothing gets logged, using either the ios emulator or an iPad device.
Ideally I also want livereload but I'll take what I can get.
I eventually got to display console logs in Xcode but that involves running
cordova platform prepare
then running the process from Xcode manually every time I make a single edit. This takes much longer than
ionic cordova run ios --target="iPad-Air" -c
Why can I not just see the logs when I use run?
I have looked at where it says the console.log file is saved to but no file gets created. I created the file myself and gave it full 777 permissions and still nothing.
ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.0.1
Cordova Platforms : browser 5.0.3 ios 4.5.2
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.2
Node : v8.8.0
npm : 5.4.2
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
To help anyone else who has trawled the forums and tried all the solutions where it seems everyone else can console.log except you, I will post what I have discovered. This is not a total solution but may identify the cause for some.
I was specifying the target as iPad-Air. When I didn't, the simulator started in iPhone-6. That is not what I wanted but there in my console was a very welcome console log message.
So I experimented a little and found that iPad-Air 10.0 and iPad-Air-2 10.0 and above will log to the console but 9.3 and lower (Not tested exhaustively) would not.
So for me, this solution will let me continue to develop with livereload and console logs and what's left of my hair.
Hopefully it will save someone else's hair loss too.
FYI you can set your chosen device as a project default in platforms/ios/cordova/lib/run.js in the deployToSim function. There should be a line like if (emulator.indexOf('iPhone') === 0) { swap out 'iPhone' (or whatever it is for you) and replace it with 'iPad-Air-2, 10.0' or whatever you need and have available in your simulator list. ios-sim showdevicetypes
Good luck!