.xcodeprojfile in Xcode and navigating to Signing and Capabilities (picture below)
.swiftfiles highlighting the important parts and providing the information you need to make your own native Ready Player Me avatar implementation.
WebViewController.swift. This custom UIViewController designed to handle the functionality and display the WebView browser.
webkit.messageHandlers. This callback passes the
event.data(which contains the Ready Player Me avatar's
.glbfile URL). Also, notice here on the
messageHandlersthere is the ID "iosListener". This is ID important for the setup inside the
source:is set to our
message.body. In our example, we pass this to an avatarurlDelegate.avatarUrlCallback function which passes the data to the main ViewController which is then displayed in a native popup.
viewDidLoad()function. Here, we call the
createWebView()function and set the visibility values for the buttons to true and hide the webViewController. Lastly, we run the
hasCookies()function to determine whether to hide the
editAvatarButton. It is only possible to edit an existing avatar if one has been created and avatar data is stored in the browser's cookies. So but running this function we can determine whether to hide or sow the
tagwhich is used as an identifier inside the
avatarUrlCallback(url: string)function is called by the
webViewControllerand it is fired when the avatar creation process is completed thanks to our
view.tagidentifier set in the
CreateWebView()function to determine which view to remove.
webCacheCleaner.swiftwith a single function
clean()for clearing the web view browser's cookies and cache.