Show alert popup n^(th) time the app is opened

I’d like for the user to see a popup the 5th time after the app is opened. I’ve been able to successfully show a popup automatically, but how would I track the number of times the app was opened before showing the popup?

Here’s my current setup for the popup:

you can try something like:
$localstorage.counter ++;
if ($localstorage.counter==5){
// do stuff

with ng-storage plugin:

1 Like