Has anybody successfully used addUIInterruptionMonitor to clear the alert produced by start()ing an SFAuthenticationSession while running an XCUITest?
I can't get it to work on Xcode 9.1/iOS 11.1.1 (simulator or device). The standard advice (setting up the handler and subsequently interacting with the device before the alert appears) does not help.
The test recorder says app.alerts.firstMatch.buttons["Continue"]).tap() should do the trick, but that doesn't work either. This technique from another SO answer works sometimes, but not consistently on CI.
So I'd like to know if the "official" solution has ever worked for anyone.
I couldn't get this to work:
let continueButton = app.alerts.buttons["Continue"]
XCTAssert(waitAndTap(continueButton), "could not tap on alert \"Continue\" button"
But this hack seems to do the trick:
let statusBarsQuery = app.statusBars
statusBarsQuery.element.tap()
Related
Today, likely as a result of upgrading to iOS 12.3 on my test phone, I am now receiving the following notifications in my debug console when I first instantiate my MPVolumeView.
019-05-21 11:00:22.874353-0600 sports-audio-dj[3831:982163]
[MediaRemote] OutputDeviceUID is nil Speaker: (null)
I receive about 10+ of these.
Here is the code that kicks it off:
let volumeView = MPVolumeView(frame: self.view.bounds)
My code hasn't changed and I'd not seen this before today and wondering if anyone knows what is bringing this about and if I need to do anything about it if something is now unhappy. My app seems to work fine despite these new notifications.
Apple responded today with the following:
You can safely ignore this debugging message. It will be removed in a future version of iOS.
iOS 13 has finally removed these errant debug messages.
I just noticed that after having updated Xcode to version 10.2.1, I'm unable to see the permission request for Library and Apple Music when launching a couple of projects of mine on the simulator.
Debugging, I realised that the authorization request call goes unanswered
MPMediaLibrary.requestAuthorization { status in
// switch on status and handle it - never gets there
}
I didn't change anything in the code or configuration of my projects, and I'm very sure that this wasn't happening with previous versions of Xcode.
Just for the record, everything works fine on a real device.
Does anybody have any idea?
Am I the only one who's experiencing this?
Looks like it doesn't work on the simulator. It now just hangs, and the closure is never executed.
It did, at one time, but I guess that it no longer does.
Sort of unsurprising, as the basic media capabilities aren't really supported on the simulator anyway.
I have tested my code on device, and verified that it works, but it is annoying (not a showstopper) that it doesn't work on the simulator.
I am using RPSystemBroadcastPickerView to show a picker view, from which a user can select a broadcast service to record the screen. Based on documentation, preferredExtension should allow me to set which broadcast extension should the picker show.
The code is super simple:
let broadcastPickerView = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: 51, height: 51))
view.addSubview(broadcastPickerView)
broadcastPickerView.preferredExtension = "com.milan.nosal.broadcast-extension"
broadcastPickerView.backgroundColor = .clear
broadcastPickerView.showsMicrophoneButton = false
where "com.milan.nosal.broadcast-extension" is the bundle identifier of the extension I want the picker to offer (I checked its correctness multiple times).
However, when the control is tapped, at first the pop up shows empty selection:
After you close it, and tap the control again, it shows the correct extension. This only happens when the app is installed (or reinstalled), after it shows, then it shows always.
Is this the iOS 12 beta bug, or am I doing something incorrectly? Can I "preregister" the extension to work around this?
EDIT:
After publishing the app, we encountered the same problem with our users, but this time not even tapping the control multiple times helps - the picker is always empty! It seems that the extension is installed correctly, because it can be launched from control center.
Running on official release now.
Note that this is for ANY iOS Version:
I just burned a full day on this. When you add the BroadCast extension, Apple will automatically add the highest possible iOS Version for the deployment target. You need to make sure this isn't higher than your physical device's iOS Version. You won't get any build errors, they just won't show your app in the broadcast extension list.
I think it is the apple's bug, but it was fixed in iOS 12.2 after I tested it.
I have the same issue, looks like Xcode has some issues how to install broadcastExtension with you app. For me, It is related only for Debug mode. To see correct UI, try to enable broadcasting once in old way (control center -> deep touch -> start broadcast), after that in your BroadcastPickerView you will see correct UI (you are pushing iOS to update information about the extension). Cannot reproduce in release mode.
You can find your exactly preferedExtension here:
When you add pickerView.preferredExtension exactly the Bundle Identifier, your app will be showed on the Recording App List. Hope this helps!
If I do not set ".preferredExtension", I see all extensions on the list.
I tested on iOS12 GM.
You add Broadcast Upload Extension into your project and get that Extension Bundle Identifier.
How to create Broadcast Upload Extension into your app?
Go to xcode - File - New - Target - Broadcast Upload Extension
Then Add this line into your app. when you created RPSystemBroadcastPickerView object.
broadCastPicker?.preferredExtension = "com.vikrant.YourApp.Extension"
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.
SOLVED : The latest update solved the problem somehow.
I am experiencing a very odd problem. Whenever I click(tap) the button on my Monodroid app, nothing happens!(I can just hear the tick sound and nothing else).
Let me clarify that things have been going very well before, but today I have been experiencing this unusual problem. Following is the code.
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button button = FindViewById<Button>(Resource.Id.button1);
ProgressBar progressbar = FindViewById<progressbar>(Resource.Id.progressbar1);
Now I've tried to fire click event in three following ways,
button.Click +=new EventHandler(button_Click);
button.Click +=(sender,e)=> {//stuff;};
button.Click += delegate {//stuff; };
In all of the methods, if I update the method (like changing the button's text), it works but if I try to do anything else it doesn't work.
What I've tried that doesn't work in the above mentioned handlers:-
Toast.MakeText(this, "blabla", ToastLength.Long);
progressbar.visibility = viewstates.visible etc
This button click event has been working fine!, even I has one app implementing the above mentioned tasks which worked but upon re-compiling from visual studio and installing the app on device, it didn't work.
Yes!, I have restarted my PC, Android device, made new programs to test the functionality but it didn't work!.
I have tried the above both on an emulator and Android device( Galaxy S2). I have used both Visual Studio and MonoDevelop and I get the same result. Please help, this is a really odd problem. I have never faced such click event handling in years until now.
Solved!, the latest update solved the problem.