Mac App Store (OSX) Improve the performance of the app

1

Stats

2,149 visits, 3,707 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 5 Feb, 2014. Last updated 19 Feb, 2019

Mac APP Store is a very simple opportunity to expand the market.

Create a publishable native App on Mac App Store is as simple as creating a project that includes a Webview reference the index.html file exported in Construct 2.

The problem is that the Webkit Framework included in Xcode provides a window of LIMITED Safari in the Webkit. You know that Safari by default does not include support for WebGL and thus adversely affect the performance of your games.

Luckily, there is a method to enable WebGL on Xcode Webkit and other methods to improve the overall performance of the application and does not influence in the review and publication process within Mac App Store.

To improve performance we will make the following changes:

1 - Download WebPreferencesPrivate.h file. It will allow you to have properties that are not enabled by default in the Xcode Webkit. You can get it here.

2 - Enter WebPreferencesPrivate.h file to your Xcode project.

3 - In AppDelegate.h make the following reference:

#include "WebPreferencesPrivate.h"

4 - In AppDelegate.m enter the following code to enable Webview properties:

WebPreferences * prefs = [self.webView preferences];

[prefs setLocalStorageEnabled: YES];

[prefs setDatabasesEnabled: YES];

[prefs setWebGLEnabled: YES];

[prefs setOfflineWebApplicationCacheEnabled: YES];

So we access the Webview not implemented the necessary properties and active methods.

Also establish the background of Webview to NO to speed up the render functions.

[webView setDrawsBackground: NO];

5 - In addition AND OPTIONAL we can establish one last modification further improves performance, although we must bear in mind that affects the compatibility of platforms. It is set as default Build Settings SDK version 10.9. This improvement is due to the Webkit Framework version 10.9 is more agile than before. The only problem is that the application can be downloaded by users who have installed OSX 10.9 (This is not a problem since the vast majority of users have this version which is also free.)

Sorry my English is poor im spanish.

  • 0 Comments

Want to leave a comment? Login or Register an account!