最近要做个AppClips的调研,打算做个系列,分三个模块,这是第一篇
苹果官方文档里的内容,但是知道的人不多,分享一下。
下载App Clip Code Generator,使用方法参考Creating App Clip Codes with the App Clip Code Generator
常用命令:
输入下面的命令:
AppClipCodeGenerator templates
输出:
Index: 0 Foreground: FFFFFF Background: 000000
Index: 1 Foreground: 000000 Background: FFFFFF
Index: 2 Foreground: FFFFFF Background: 777777
Index: 3 Foreground: 777777 Background: FFFFFF
Index: 4 Foreground: FFFFFF Background: FF3B30
Index: 5 Foreground: FF3B30 Background: FFFFFF
Index: 6 Foreground: FFFFFF Background: EE7733
Index: 7 Foreground: EE7733 Background: FFFFFF
Index: 8 Foreground: FFFFFF Background: 33AA22
Index: 9 Foreground: 33AA22 Background: FFFFFF
Index: 10 Foreground: FFFFFF Background: 00A6A1
Index: 11 Foreground: 00A6A1 Background: FFFFFF
Index: 12 Foreground: FFFFFF Background: 007AFF
Index: 13 Foreground: 007AFF Background: FFFFFF
Index: 14 Foreground: FFFFFF Background: 5856D6
Index: 15 Foreground: 5856D6 Background: FFFFFF
Index: 16 Foreground: FFFFFF Background: CC73E1
Index: 17 Foreground: CC73E1 Background: FFFFFF
Foreground和Background的颜色分别指的是什么,参考下图。
AppClipCodeGenerator suggest --foreground $foregroundColor --background $backgroundColor
把 $foregroundColor和 $backgroundColor替换为自己的要设置的颜色。
eg:
AppClipCodeGenerator suggest --foreground 65D212 --background 5B1637
下面的 https://appclip.example.com 指的是代码中绑定了AppClips的地址。
~/path/to/filename.svg 指的是最终生成文件的路径和名字
AppClipCodeGenerator generate --url https://appclip.example.com --index 9 --output ~/path/to/filename.svg
AppClipCodeGenerator generate --url https://appclip.example.com --index 9 --logo none --output ~/path/to/filename.svg
AppClipCodeGenerator generate --url https://appclip.example.com --index 9 --output ~/path/to/filename.svg --type nfc
AppClipCodeGenerator generate --url https://appclip.example.com --foreground 123456 --background FFFFFF --output ~/path/to/filename.svg
AppClipCodeGenerator --help
末尾
官方还提供了使用python,一次生成多个轻应用码的示例,但我这边没这个需求,就不显示了。