The TestFlight iOS SDK already supports this for beta versions if you have the SDK integrated into your app:
Beta In App Updates
If a user is using a beta version of your app, you are setting the UDID, a new beta version is available, and that user has permission to install it; an in app popup will ask them if they would like to install the update. If they tap "Install", the new version is installed from inside the app.
NB: For this to work, you must increment your build version before uploading. Otherwise the new and old builds will have the same version number and we won't know if the user needs to update or is already using the new version.
To turn this off set this option before calling takeOff:
[TestFlight setOptions:@{ TFOptionDisableInAppUpdates : @YES }];