Removing Firefox Addon prefs when a user uninstalls - firefox-addon

I'm working on a firefox addon and one thing i'm unsure on is how to remove user preferences related to my addon when the user uninstalls it. The preferences get set, and if the user uninstalls and reinstalls the preferences are all still there. Some settings also relate to a first time install, so that breaks if the user has installed it previously.
Is there something I can setup that will be called when a user uninstalls, or a process to remove preferences on uninstall?
Thanks!

You'll want to take a look at this page which shows you how to register an observer to get the right events. Note that it's not always 100% reliable, but there should be a way to do this in Firefox 3.7 (Gecko 1.9.3).

There is no way to do this. Addons are simply deleted off by the browser and not told that they will be uninstalled. You could provide a 'Restore Factory Settings' button somewhere on your add on GUI.

Related

iOS | Always logged in at the start of every new test

Not sure was this already asked here, but I could use help with an issue. I will provide any additional info if needed.
As said in the title, I would like to not be logged in after every test has been run, since I need to go through login test first. My colleague on Android just goes through her test, and does Driver.Quit/Dispose(); at the end, and she’s logged out for every other/next test after that.
On the other hand, for me (iOS), after I dispose of my driver - when the next test starts, I’m frequently (if not all the time) already logged in, and then I need to handle that case as well - and I’m trying to avoid it. I know that some login data is kept in the iOS keychain - and I can reproduce this issue manually with our app - if I uninstall the app, while being logged in - after I reinstall the app and start it - I’m already logged in.
Is there a way to handle this in a proper way? I’ve tried a lot of things, like actually logging out through the app, but that adds additional code, and makes it more complicated. Tried few additional capabilities - but nothing worked.
Note: It sounds like your app is keeping you logged in even with terminating/reinstalling the app. I would take a look closer and see if there's an issue attempting to log the user out when the app terminates or if there's a reason it's not coming to the login page after reinstalling.
I have code inside my iOS app that closes out the app if the app is terminated. And the below code works for me with appium as it terminates the app which also means it logs me out.
Try this to terminate your app:
const bundleId = "com.yourappsbundleid"
driver.terminateApp(bundleId)
Also note that appium's website provides more information and also ways to do this in other languages. See: https://appium.io/docs/en/commands/device/app/terminate-app/

iOS - Logout from Apple Store / Restore Device Programmatically

I'm automating test cases to run in several devices in parallel. I'm using Appium for this and this works fine. My issue is that I have some test cases that need the device to be logged into specific Apple Store accounts. Also, it is possible that the device might already be logged into another account and I don't have the option to logout manually. My test cases to log into an account if the device has no account attached to it already run well (inside my app I try to do an action that requires an Apple ID, the alert requiring login appears and I already automated the login process). The issue is when the device is already logged into another account.
My two options are:
Force the device to log out from Apple Store
Create a device backup without being logged and restore this backup before my test
I wasn't able to find a way to handle the first option. The second one works using idevicebackup2 (a lib from libimobiledevice). The issue here is that after restoring the device data, the setup wizard appear and there is no way to get rid of it automatically. I tried using cfgutils to remove the wizard steps, but even after removing all steps, the wizard appears just waiting for a confirmation after restoring.
I would like to know if there is a way to go for the first option, or a way to skip the setup wizard in the second option, or maybe a way to restore the backup partially (just clearing the Apple ID data) in order to avoid rebooting the device and getting stuck with the wizard again. Thanks in advance.
One option available now with Xcode 9 is the new multi-app testing. You can now call any app on the system based on it's bundle identifier XCUIApplication(bundleIdentifier: "com.MEGACORP.xyz") during a XCUI test. They cover the new API and examples in WWDC session 409 - What's New in Testing - it's worth watching the whole thing.
I've written some tests using the new API to switch out of the app under test and open System Settings to reset the app state during the test teardown. There's a list of all the system bundle ids in this question.
Your test would start with something like:
let store = XCUIApplication(bundleIdentifier: "com.apple.AppStore")
store.launch()

Make users manually update app

In iOS7 my application is automatically updated... Is there any way I can release an update of my app and make the plist or something so that the app will NOT be auto-updated by the device, but instead users will only get the update if the manually go to the AppStore and update it?
This is not possible. You need to find a way to notify your users their app has been updated. For example, alert your users the first time their open the app that it has been updated.
Clash of Clans app prompts an alert telling that there is a new update available. The caveat is that this is a online game so the user needs to have internet access to play it. If the user expects to use your application offline and you previously stored an information that the app needs an update and you don't allow the user use it can be frustrating.

Where is the "iOS Would Like Access to Twitter Accounts" alert?

When you first ever open a new app, whether you're a developer making one, or you have just downloaded from the app store, if Twitter access is needed, it will ask for it.
I can only get this AlertView to show once, per device. No matter what I do, I can't get it back, deleting the app + data, re-building it from Xcode, revoking access to Twitter accounts on the device itself...
None of these work.
I can detect in the code whether on not I have access to Twitter, but it was more of a UI problem I was having when it first appeared. So I really need to see it again.
If anyone could help that'd be great!
To invoke the dialog again, change app id temporarily. Since app id uniquely identifies an app, it'll be like a new app.

Blackberry installation problem: users miss OK dialogs and the app ends up not being installed

We have a Blackberry app that is installed by users OTA. The install works fine as long as the user clicks OK on all of the dialog boxes that come up during the process.
However, if something else happens during installation (like a phone call or whatever), the user ends up never clicking the dialogs, so the app is never completely installed successfully.
Is there any way to force an installation process to re-show the dialogs if the user wanders away? Alternatively (or additionally), is there any way for an app to be aware that one or more components have not been installed successfully? Right now the app starts up but then spins forever, if everything has not been installed correctly.
Sorry if a lot of this doesn't make sense - I'm not a Blackberry developer, but I've been charged with investigating this problem generally.
If you can reproduce the problem on a device, dump the event log and take a look. If I had to guess, I'd say that the dialogs being skipped are permission-granting dialogs or maybe even firewall dialogs. If this is the case, you'll see various exceptions thrown by your app (i.e. ControlledAccessException). You can work around this by catching the exception and displaying a proper message informing them that they need to take some action (i.e. allow app in the firewall settings). If it's a case of needing additional application permissions, you can use the ApplicationPermissionsManager class to see what permissions your app has been granted, and to ask for additional permissions if required.

Resources