问题
Is there an easy and smooth way how to detect if an app is run the first time? I know, it would be possible to set a cookie and check if it exists but is there another - maybe even better - way?
回答1:
I take it that you mean first time on a given computer, as distinct from first time in a given document or first time by a given user. In that case, the cookie, or local storage, is probably your easiest/smoothest strategy. If your add-in is going to have a server-side storage of purchasers/clients/users anyway, then you could also use a flag in that storage. This SharePoint tutorial is an example of a server-side strategy.
来源:https://stackoverflow.com/questions/50756976/is-there-any-best-practice-how-to-detect-a-first-run-of-the-app