0

I'm working but on iOS dynamic quick actions, and I want to use image from url, to be set as the quick action icon.

Is it possible? I didn't find an answer for that..

yershalom
  • 786
  • 1
  • 8
  • 19

1 Answers1

1

Unfortunately, it's not possible using public API.

UIApplicationShortcutIcon only allows creating icons from contacts, images found in the bundle or predefined system icons.

If you are willing to use private API (you shouldn't), there exist two methods which allow this:

+ (id)iconWithCustomImage:(id)arg1 isTemplate:(_Bool)arg2;
+ (id)iconWithCustomImage:(id)arg1;

It still wouldn't be a URL. You'd need to create a UIImage instance and call these methods with that image.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
  • 2
    since this is the approved answer, I will stress on that **you shouldn't**: please bear in mind that using private APIs will likely have your app rejected if you submit it to the App Store. And if it doesn't get rejected on the first release, it might be at any time in the future. – il3v Jan 08 '19 at 14:40
  • I agree with @il3v. While it is possible to hide private API use, it is still not recommended as it can cause crashes or otherwise unexpected behavior in future iOS versions. – Léo Natan Jan 08 '19 at 14:42