First, in Info.plist you write:
<key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>HTML</string> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>public.html</string> <string>public.xhtml</string> </array> </dict> </array>
In AppDelegate:
//Swift func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { //do something with html file here return true } //Objective-C - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { //do something with html file here return YES; }
And transmit:

To get the Safari url, create the App Extension:
File -> New -> Target -> Share Extension

Agree to create a scheme, run and see:

Scheme of how it works: 
Read more in the Documentation.
Next you need to configure. For starters in
- (BOOL)isContentValid { // Do validation of contentText and/or NSExtensionContext attachments here return YES; }
Check what you need and, if appropriate, return YES; if something is wrong then return NO; .
Enable and configure App Groups:

And you can save data through NSUserDefaults:
NSUserDefaults *shared = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.test.one"]; [shared setObject:object forKey:@"yourkey"]; [shared synchronize];
Receive:
NSUserDefaults *shared = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.test.one"]; id value = [shared valueForKey:@"yourkey"]; NSLog(@"%@",value);