3

For background: I'm running UI automation (using Calabash) on our iOS app and can navigate the Sign In dialog to select "Use Existing Apple ID" when purchasing content. However, the next dialog is the "Apple ID Password" dialog which our contains the username and password field. Our automation can't navigate it since it is a native dialog.

Is there any way to set/clear those values programmatically, so I can bypass that dialog?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Teresa Peters
  • 229
  • 3
  • 14

4 Answers4

2

You cannot auto-fill user's Apple id and bypass that alert which comes while the user is going to purchase something with InApp purchase. It is automatically promoted while you write a code for SKPayment. We don't have control on what you are asking for.

NSPratik
  • 4,714
  • 7
  • 51
  • 81
  • 1
    I originally posted this question hoping to pass it in via some Objective-C method in some existing library somewhere. Does Apple remove the ability to do that? What if a company created an app and wanted to always charge some specific account and wanted to build in that account without its users having to know the username and password? There's no way to do that? – Teresa Peters Sep 21 '15 at 18:47
  • Otherwise Apps would write a code and automatically charge the users without their permissions. In short, whatever you are asking for is not possible at all.. – NSPratik Dec 17 '15 at 10:12
  • I was able to interact with it after all. I posted the code I used below. – Teresa Peters Mar 11 '16 at 17:15
2

It is not possible to interact with the In App purchases prompt for username/password authentication using UIAutomation or Calabash.

The only way I have been able to make this work is to use backdoors. This was back in July 2013. I was not satisfied with the results.

This feature has been requested before, but our hands are tied until Apple improves its UIAutomation JavaScript API. You could try to file a bug/feature request.

You try to interact with this dialog with the Automation tool in Xcode 7's Instruments app. If you can demonstrate that you can interact with the alert using UIAutomation, we can try to add support in Calabash.

jmoody
  • 2,480
  • 1
  • 16
  • 22
  • 1
    Actually @jmoody I was able to interact with the native dialog with Calabash using some of your Briar code and a couple other UIA calls on device (but not simulator). I can post the code here in a bit. – Teresa Peters Sep 21 '15 at 18:41
  • 1
    How were you able to sign in using a backdoor? Interacting with our app code is what I was originally looking for but will use this UIA call way instead. – Teresa Peters Sep 21 '15 at 18:43
1

Interacting with native dialogs was possible. Here's a gist containing the class I wrote, in case it helps others who find themselves in a similar situation.

https://gist.github.com/TeresaP/b7373a907ebb31acac39

Teresa Peters
  • 229
  • 3
  • 14
0

no this is not possible you must have to setup different test id in iTunes connect for testing purpose also it should be different then apple developer id only email address should be valid email address when creating test in app purchase

AFTAB MUHAMMED KHAN
  • 2,189
  • 3
  • 18
  • 24
  • 1
    I have the username/password values but I want to be able to set them programmatically so I can bypass this dialog. – Teresa Peters Sep 17 '15 at 22:24
  • which dialog i don’t get your point do you mean the dialog box which asking for typing apple id and password. no you can’t because this dialog is popping from uisharedapplication.its very similar like you can’t customise the email composer in Xcode – AFTAB MUHAMMED KHAN Sep 17 '15 at 22:31
  • One the user has entered their Apple ID one time, we won't get this dialog again. My question was about how to enter it programmatically (maybe there is some sort of Objective-C library or something) so we never get to that dialog. The dialog is titled "Apple ID Password" and you see it when doing in-app purchasing. – Teresa Peters Sep 17 '15 at 22:52
  • @rmaddy that is why I added the objective-c tag. Not sure why you removed it. – Teresa Peters Sep 17 '15 at 22:53
  • No if you delete the app and reinstall you will get this popover again that is the only way to achieve it . This restriction is from apple side if its helps you please accept the answer or vote up thanks – AFTAB MUHAMMED KHAN Sep 17 '15 at 22:55
  • You haven't answered my question, but thank you for your time. – Teresa Peters Sep 17 '15 at 23:14
  • Np i try to give u answer from the best of my knowledge let see how can answer this question – AFTAB MUHAMMED KHAN Sep 17 '15 at 23:25