HMS Push Kit, getToken() method is not working on Android version 9 - huawei-mobile-services

In HMS Push Kit, getToken() method is not working on Android version 9 (not getting token). but in Android 10 version, token is getting with same method.
Tested in two devices:
Honor 9X Pro
HLK-L42
Android version 9
EMUI 9.1.1
Honor 9S
Model: DUA-LX9
Android version 10
Magic UI 3.1.0

Check Whether you are using HmsMessageService.onNewToken for get new token for device less than EMUI 9.1.
If not then for EMUI version is earlier than 10.0, call onNewToken method to return a token.
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-client-dev-0000001050042041

As described here in this FAQ: https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/faq-0000001050042183
What can I do if the onNewToken method cannot be called back when the EMUI version is earlier than 10.0?
If the EMUI version on a Huawei device is earlier than 10.0 and no token is returned using the getToken method, a token will be returned through the onNewToken method. If the onNewToken method cannot be called back, check whether Push Kit is enabled.
Please try out onNewToken as described in this.

Related

SDK error when publishing the application

good day guys, someone happened the same thing, I have a problem when publishing a new version of my app in the PlayStore, I don't know if it is correct to update my SDK version:
First I got a warning and it went up normal now after about 2 weeks
I am uploading a new update and it sends me this error.
App Store Connect Operation Error
ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 13.6 SDK. All
iOS apps submitted to the App Store must be built with the iOS 14 SDK or later, included in Xcode 12 or later."
my current version of Xcode is 11.6
Since the new privacy changes released, you should upload your app with Xcode 12 or later. It is also written on error message.
Xcode 11 doesn't have App Tracking Transparency framework so Apple blocks the app's which are uploaded previous version of Xcode 12.

Getting iOS version before enrollment (Without Agent)

How to conditionally set the
<key>AccessRights</key>
<integer>$enrollment_code</integer>
in MDM enrollment profile based on iOS version its getting installed..
like 5.0 and above it must be 8191
and below 5.0 it needs to be 2047
In the Phase1: profile service, we do not get the iOS version..
So where to get the iOS version before enrollment.
PS: I am enrolling devices without agent (So agent cannot be an option to send it)
You can use the User-Agent reported from the browser.

How to debug iOS app build with lower SDK on device with higher iOS

I'm using xCode 3.2.3 with 4.0 iOS SDK, but my iTouch has iOS 4.2 installed.
I could deploy and run Release version app on my iTouch, but when I try to debug app on device, the app is always running with nothing but black screen, without any response.
The problem is:
How to debug iOS app build with 4.0 SDK on device installed iOS 4.2?
If you go to Xcode's organizer you'll see that your device is actually not allowed to run the debug mode (with a development provision file), since your SDK version is lower than your device's OS. Apple just doesn't allow that to happen.
I assume that you want to keep your old SDK is because you want to check the compatibility with older OS. I would suggest you upgrade your Xcode and its SDK to the latest version (3.2.5/4.2.1) while testing your app on old and new OS devices.
Try installing the latest iOS SDK to another folder (mine is at /DeveloperBeta). That way you could continue developing and debugging using the new SDK, while still having the old SDK around to build for app submission.

Automated check for calls to APIs that are not supported in iOS < 4.0?

I'm trying to keep my app compatible with iOS 3.1 while also adding support for some new features of iOS 4, like limited-duration background tasks (beginBackgroundTaskWithExpirationHandler:).
Of course the proper way to do this is to check respondsToSelector: for each appropriate call, but I'm still afraid I'll miss a call here or there. Is there a way to check for any calls I might have missed in an automated fashion—some tool I can run while compiling?
I could simply build with SDK 3.1 as my active SDK, but Apple no longer installs SDK 3.1 and I don't know where to find it any longer.
You can install a second XCode at a different location. So you could open your project with that older xcode for building with SDK 3.1.
I have been trying to integrate the older SDK into my newer XCode so that I'd be able to use SDK 3.0, 3.1, 3.2 and 4.0 all from the same XCode installation but these attempt weren't successful so far.

iTunes Connect rejects my binary because I used a pre-release version of the SDK, what should I do?

I downloaded a pre-release version of the iPhone SDK and tried to update one of my existing apps using a binary I built with it. Obviously you are not supposed to do this but I had forgotten about the warning when I installed the pre-release SDK. Anyway - I have two questions:
Can I simply set the base SDK to an earlier version in the build settings and get around this problem?
If not, then what should I do?
You need to download the release version of Xcode with the release iPhone SDK. You can't use the SDK downloaded from the iPad beta version for any release products.
Just go to http://developer.apple.com/iphone/index.action and click on iPhone SDK 3.1 and download it. Then build your app bundle with that and submit it to Apple.
Before you download a pre-release version of the SDK from developer.apple.com, there are several prominent warnings, one of which clearly states that pre-release versions of Xcode / iPhone SDK can NOT be used to build production binaries. So the answer to 1. is an emphatic no.
As far as I can tell, the only option to be able to build production binaries that iTunes Connect will accept is to delete the pre-release version of Xcode / iPhone SDK and re-install the older stable version.
If you upgraded using the beta download (as opposed to installing on a fresh box that has never seen SDK or Xcode), set the base SDK to a released version of the OS. Compile a Distribution build, submit to the app store. The old SDK is still there, so that will get used. All of the prominent warnings I have seen state the the SDK cannot be used, without mention of Xcode.
Before anyone scoffs, note that I submitted an app on March 13 using the version of Xcode (3.2.2) included in Beta 4, setting Base SDK to 3.1. It was approved on the 15th. I've also done this during the 3.0 beta for 2.x apps.
EDIT: on the other hand, acceptance apparently isn't always guaranteed (note that this person had also submitted an app that did get accepted): The binary you uploaded was invalid. A pre-release beta version of the SDK was used to build the application