ARHomeScreenShortcuts会将主屏幕快捷方式安装到您的应用程序的功能中,比如OneTap或Facebook Groups。
您需要为您的应用程序定义一个URL方案。
要运行示例项目,首先克隆仓库,然后在示例目录中运行pod install
。
要自定义快捷方式,您可以使用以下属性
ARHomeScreenShortcuts *shortcut = [[ARHomeScreenShortcuts alloc] init];
shortcut.title = @"Shortcut Title";
shortcut.icon = [UIImage imageNamed:@"ShortcutIcon"];
shortcut.urlScheme = @"myapp";
shortcut.action = @"open"
shortcut.parameters = @{@"id" : @"my_identifier"};
[shortcut.replacementDictionary setObject:@"<div>INSTALL ME</div>" forKey:@"<REPLACEMENT_EXAMPLE>"];
[homeScreenShortcuts installShortcut];
要自定义安装HTML,请将ARHomeScreenShortcuts.html文件复制到您的项目中。
向作者推文@alexruperez,并查看alexruperez的博客:http://alexruperez.com
ARHomeScreenShortcuts可在MIT许可证下获得。有关更多信息,请参阅LICENSE文件。