How could I create a shortcut on desktop in iOS through an app

后端 未结 3 1127
深忆病人
深忆病人 2020-12-08 08:41

What do I mean is that I want to use the app to create a shortcut with icon on the desktop which will allow user to speed access some functions of this app.

How coul

3条回答
  •  情书的邮戳
    2020-12-08 09:23

    I guess the application works as follows,

    1) It just creating a html for each contact

    2) It using the safari functionality "Add to home screen"

    Found an excellent answer for simulating the safari functionality,

    I created an link from Safari using the "Add To Home Screen" button. It created a directory called 54C86B09482D4560BAB46091CC75825A.webclip inside of /private/var/mobile/Library/WebClips/. That directory contains two files, icon.png and Info.plist. icon.png is simply the icon that gets shown when looking at the apps screen. The contents of Info.plist are where the real information is:

    
    
    
    
            ClassicMode
            
            FullScreen
            
            IconIsPrecomposed
            
            IconIsScreenShotBased
            
            Scale
            0.32653060555458069
            ScrollPoint
            
                    x
                    0.0
                    y
                    -183
            
            Title
            The Daily WTF
            UIStatusBarStyle
            UIStatusBarStyleGray
            URL
            http://thedailywtf.com/
    
    
    

    So, to test this out I created a new folder called C28C8FDC2F184AAD84F77B511442548F.webclip and copied the Info.plist file over from the other directory, edited the url to http://google.com. I then re-sprung the phone and it showed up just like any other webclip. The folder name is simply a hex encoded GUID, I used http://www.somacon.com/p113.php and just selected what was after 0x for this simple test

提交回复
热议问题