Is there any way by which I can run a function only once (when the app is updated or installed)?

I can't use run script as I should use an Objective-C function.

Edit
Report