CodeModuleManager.CMM_OK_MODULE_MARKED_FOR_DELETION on BlackBerry device - blackberry

When I call CodeModuleManager.deleteModuleEx() to delete a Module, the return value is CodeModuleManager.CMM_OK_MODULE_MARKED_FOR_DELETION using the simulator, but the return value is CodeModuleManager.CMM_OK when I run same application on device. The device is a 9700 and the Platform is 5.1.0.121.

i think after deletion reset is required. if you are not doing already,
add this code also.
if (CodeModuleManager.isResetRequired())
CodeModuleManager.promptForResetIfRequired();

Related

iPhone Jailbroken Issue with Xcode 9

Need to check whether device is jailbroken using cordova. I tried the cordova-plugin-jailbreak-detection plugin, but still can open the same in JAILBROKEN Device. then i got .m files from https://github.com/Shmoopi/AntiPiracy. it was working fine till XCode 8. In XCode 9, getting "System keyword is unavailable" error
Any latest plugin/class files to check Jailbroken compatible for latest XCode ?
system call is not available for ios, remove + (int)systemCheck and it should work for you. Also in + (void)killApplication method comment system call
The isJailbroken method performs various check and if the score is >= 3 then it marks it as Jail broken. Now as the system call is not available then we can live without the score of + (int)systemCheck and proceed without it.

Xamarin.UITests - testing on real device - iOS - app permissions popups issue

I've iOS app that needs some privileges (GPS, Push notifications).
When app starts for a first time iOS asks user if they're ok with granting those permissions to application.
I've written some UITests and want to automate running them on locally connected iPhone.
The problem is that I cannot override permissions questions and my tests fails.
I found out that application deployed by IDE (Xamarin Studio) will ask for permissions, but application deployed via UITests will not.
So I tried with .AppBundle(path_to_app) but it says this is only valid for deploying to Simulator.
SetUp : System.Exception : This app bundle is not valid for running on
a simulator. To fix this issue please ensure that your target device
is a simulator. DTPlatformName is 'iphoneos', not 'iphonesimulator' in
the apps Info.plist.
Like it's trying to deploy iPhone app to Simulator. But Target in Xamarin Studio is set to real device.
I tried to add .DeviceIdentifier. When Used with .InstalledApp it was starting up (still asking for permissions).
But when I used DeviceIdentifier and AppBundle there was the same error as above.
My tests works fine on Test Cloud. They work fine on Simulator.
They work fine when I deploy to device manually, start app and approve permissions then run UI tests.
What I cannot achieve is to make UITests override permissions questions on real device.
Anyone made this work?
Last thing is that I found is in documentation for AppBundle method
"Will force a run on simulator"
https://developer.xamarin.com/api/member/Xamarin.UITest.Configuration.iOSAppConfigurator.AppBundle/p/System.String/
So I may be doomed with the task but maybe someone knows a workaround?
You can dismiss system dialogs with UITest by using InvokeUIA. The test below works by tapping the "OK" button of an iOS system alert:
[Test]
public void AppLaunches ()
{
app.Screenshot ("First screen.");
app.InvokeUia ("uia.query('[:view {:marked \"OK\"}]')");
app.InvokeUia ("uia.tapMark(\"OK\")");
}
A working sample app & UITest is also here:
https://github.com/King-of-Spades/InvokeUia-for-System-Dialogs
Warning about system dialogs in Test Cloud
The reason that you don't see this issue in Test Cloud is because Test Cloud automatically dismisses the system alerts; so usually you don't have to worry about it. However, if your alert launches too soon; so that it appears before the automation has fully started your app, then it will be unable to detect & dismiss the alert and cause your test to fail.
So you want to make sure that when running your app in Test Cloud that the request for permissions are delayed, or you can even deactivate them if they aren't explicitly needed for a particular test. More information is available in this Calabash guide: https://github.com/calabash/calabash-ios/wiki/Managing-Privacy-Alerts%3A--Location-Services%2C-APNS%2C-Contacts
(Even though it's Calabash, you can use the same strategy in UITest; albeit with a C# syntax.)
Update for Xcode 8 / iOS 10
Xcode 8 / iOS 10 removed UIAutomation, so the InvokeUIA workaround will only continue to be possible if you're using Xcode 7 and iOS 7-9. References:
UITest: https://developer.xamarin.com/guides/testcloud/UITest/xcode7/
Calabash: https://developer.xamarin.com/guides/testcloud/calabash/xcode7/#Automation_API
For real devices you dont need any of those.
{
app = ConfigureApp
.iOSAppBundle
.StartApp();
}
this piece of code is good enough, if you are connecting real device to the system, then select that before running.
We use this to execute the UI tests on iPhones:
ConfigureApp.iOS.InstalledApp("com.appcenter.UITestDemo").StartApp();
InstalledApp requires you to build an IPA using the Debug
configuration & a valid provisioning profile, and preinstalling it on
the target device.
https://github.com/microsoft/appcenter-Xamarin.UITest-Demo/blob/main/UITestDemo.UITest/AppInitializer.cs
To confirm system dialogs we use this:
private Query ConfirmLocalNetworkPermissionDialogButton
=> AppInitializer.Platform == Platform.iOS
? new Query(x => x.ClassFull("_UIAlertControllerActionView").Marked("OK"))
: x => x.Class("AppCompatButton").Marked("button1");

CKQueryOperation iOS 9 only work plugged in

I am using CloudKit in my iOS 9 app and I have a CKQueryOperation that work fine and performs as expected when plugged into the Mac. As soon as the query is run when it is not plugged in to the Mac, it does not finish. There is no error message, the activity indicator I added never stops and the results are never displayed.
If I start the operation when unplugged, then plug it in it completes too.
The code was copied and adapted from an app built in Xcode 6.4 and works as expected in that app.
Any ideas why this could be happening? Could it be anything to do with app thinning in iOS 9?
Thank you
ANSWER
Adding this fixed the issue:
queryOperation.qualityOfService = NSQualityOfService.UserInitiated
The default QoS changed in iOS 9. If the query operation is user initiated, then it needs to be marked as such.
See CKOperation.h and the QualityOfService property.

iOS8 - Simulator - How to get Locations simulated

My App tracks your location.
With iOS8 I had to change how it was starting location services.
I got this working with
[self.locationManager requestAlwaysAuthorization];
and adding NSLocationAlwaysUsageDescription to the plist file.
The app now gets your location when run on a device, but not in the simulator.
Any clues on how to get this to work in the simulator? It used to!!!
In the iOS Simulator, select Debug > Location, then choose your location.
I decided to post this in case anyone else had the same issue. I got the simulator to respond to location changes again by adding NSLocationWhenInUseUsageDescription back into the plist file. I had removed it since my app needs the Always permission instead of WhenInUse. By adding this back to the plist the simulator is now happy. I did not have this issue on the physical device, just the simulator.

FlashDevelop + Air - iPhone 5 size

I export to iOS using the mobile packager built into FlashDevelop.
It supports most of the devices (ios and droid) but it does not come up with
iPhone 5 testing size.
In order to set the device, Run.bat has to be edited like:
::set SCREEN_SIZE=NexusOne
::set SCREEN_SIZE=iPhoneRetina
set SCREEN_SIZE=iPad
::set SCREEN_SIZE=iPadRetina
::set SCREEN_SIZE=iPhone
But when I enter iPhone5 I get an error.
Are there any solutions since the new screen size is important?
Mirza
try using
set SCREEN_SIZE=iPhone5Retina
you can also see some other options here http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-6fa6d7e0128cca93d31-8000.html
You can use:
Capabilities.screenResolutionX
Capabilities.screenResolutionY
to catch the resolution on whichever device your app is executed on.
you might have to type
<requestedDisplayResolution>standard</requestedDisplayResolution>
in the App Descriptor XML file.

Resources