Removing iOS permission alert for local notifications when running app in simulator

后端 未结 2 1285
感动是毒
感动是毒 2021-02-05 11:55

I\'m trying to write an acceptance test in KIF on an app that asks for local notification permissions pretty early on. Unfortunately due to iOS simulator security reasons it isn

2条回答
  •  我在风中等你
    2021-02-05 12:43

    Notification permission can be suppressed by granting permission in applicationState.plist:

    • Run your app on a simulator and tap on "ok" for any permission popups
    • navigate to "~/Library/Developer/CoreSimulator/Devices/{$deviceId}/data/Library/BackBoard/applicationState.plist"
    • Replace the applicationState.plist of the UI test simulator with the above one before bootstrapping it

提交回复
热议问题