Upsight logo Back to top

Legacy PlayHaven Migration

Legacy Upgrade Steps


If you are upgrading from the legacy PlayHaven Unity Plugin, please follow these steps.

  1. Remove the legacy PlayHaven Unity Plugin from your unity project by deleting the following files and folders.

    Note Be careful not to delete a file that is also being used by your app or another 3rd party plugin.

    Assets/Editor/mod_pbxproj-readme.md
    Assets/Editor/mod_pbxproj.py
    Assets/Editor/PlayHaven
    Assets/Editor/PostprocessBuildPlayer
    Assets/Editor/PostprocessBuildPlayer_PlayHaven
    Assets/Editor Default Resources/PlayHaven
    Assets/Plugins/Android/AndroidManifest.xml
    Assets/Plugins/Android/build.xml
    Assets/Plugins/Android/default.properties
    Assets/Plugins/Android/libs/commons-lang-2.6.jar
    Assets/Plugins/Android/libs/gcm-client-3.jar
    Assets/Plugins/Android/libs/json-path-0.8.1.jar
    Assets/Plugins/Android/libs/json-smart-1.1.1.jar
    Assets/Plugins/Android/libs/playhaven.jar
    Assets/Plugins/Android/libs/PlayHavenFacade.jar
    Assets/Plugins/Android/libs/spring-android-core-1.0.1.RELEASE.jar
    Assets/Plugins/Android/libs/spring-android-rest-template-1.0.1.RELEASE.jar
    Assets/Plugins/Android/libs/support-v4-r7.jar
    Assets/Plugins/Android/local.properties
    Assets/Plugins/Android/res/drawable/playhaven.png
    Assets/Plugins/Android/res/drawable/playhaven_badge.xml
    Assets/Plugins/Android/res/drawable/playhaven_overlay.xml
    Assets/Plugins/Android/res/layout/playhaven_activity.xml
    Assets/Plugins/Android/res/layout/playhaven_dialog.xml
    Assets/Plugins/Android/res/layout/playhaven_exit.xml
    Assets/Plugins/Android/res/layout/playhaven_loadinganim.xml
    Assets/Plugins/Android/res/layout/playhaven_overlay.xml
    Assets/Plugins/Android/res/values/playhaven_attrs.xml
    Assets/Plugins/Android/res/values/playhaven_config.xml
    Assets/Plugins/Android/res/values/playhaven_styles.xml
    Assets/Plugins/Android/src/com/playhaven
    Assets/Plugins/iOS/JSON.h
    Assets/Plugins/iOS/libPlayHaven.a
    Assets/Plugins/iOS/PHAPIRequest.h
    Assets/Plugins/iOS/PHConnectionManager.h
    Assets/Plugins/iOS/PHConstants.h
    Assets/Plugins/iOS/PHContentView.h
    Assets/Plugins/iOS/PHNotificationView.h
    Assets/Plugins/iOS/PHPublisherContentRequest.h
    Assets/Plugins/iOS/PHPublisherIAPTrackingRequest.h
    Assets/Plugins/iOS/PHPublisherMetadataRequest.h
    Assets/Plugins/iOS/PHPublisherOpenRequest.h
    Assets/Plugins/iOS/PHPurchase.h
    Assets/Plugins/iOS/PHPushProvider.h
    Assets/Plugins/iOS/PHReward.h
    Assets/Plugins/iOS/PHUnityIntegration.h
    Assets/Plugins/iOS/PHUnityIntegration.mm
    Assets/Plugins/iOS/PHURLLoader.h
    Assets/Plugins/iOS/PlayHaven.bundle
    Assets/Plugins/iOS/PlayHavenSDK.h
    Assets/Plugins/iOS/SBJsonBase.h
    Assets/Plugins/iOS/SBJsonParser.h
    Assets/Plugins/iOS/SBJsonWriter.h
    Assets/Plugins/PlayHaven
    
  2. Follow the Getting Started guide for integrating the Upsight Unity Plugin into your unity project.

    Please note that you will not be able to build successfully until you complete the remaining steps below.

  3. Remove the PlayHavenManager GameObject and all references to it.

  4. Remove all ContentRequester GameObjects and replace all references with content request code calls to sendContentRequest.

  5. Replace legacy method calls with new method calls. See Replace Method Calls for more details.

  6. Replace legacy event handling with new event handling. See Replace Event Handling for more details.

  7. Test your changes by building your unity project.

Replace Method Calls


This table contains a mapping of commonly used legacy methods and the new methods to replace them.

Legacy MethodNew MethodNotes
ContentPreloadRequestpreloadContentRequest
ContentRequestsendContentRequest
DeregisterFromPushNoficationsderegisterForPushNotifications
OpenrequestAppOpenNew method must be called at app launch and when app resumes from background. customUDID parameter no longer supported.
OpenNotificationrequestAppOpenNew method must be called at app launch and when app resumes from background. customUDID parameter no longer supported.
ProductPurchaseTrackingRequesttrackInAppPurchase
RegisterForPushNotificationsregisterForPushNotificationsNew method must be called at app launch.

Replace Event Handling


This table contains a mapping of commonly used legacy events and the new events to replace them.

Legacy EventNew EventNotes
OnBadgeUpdatebadgeCountRequestSucceededEventThe new Upsight Unity Plugin only provides the ability to get the badge count for a More Games Widget. The badge UI display is no longer supported. You must display the badge count yourself.
OnDidDisplayContentcontentDidDisplayEventNew event is only supported on iOS.
OnDismissContentcontentDismissedEvent
OnErrorContentRequestcontentRequestFailedEvent
OnErrorMetadataRequestbadgeCountRequestFailedEvent
OnErrorOpenRequestopenRequestFailedEvent
OnPurchasePresentedmakePurchaseEvent
OnRewardGivenunlockedRewardEvent
OnShouldOpenContentFromRemotePushNotificationpushNotificationWithContentReceivedEventNew event is only supported on iOS. Please see Receiving Push Notifications.
OnShouldOpenURLFromRemotePushNotificationpushNotificationWithUrlReceivedEventNew event is only supported on iOS. Please see Receiving Push Notifications.
OnSuccessOpenRequestopenRequestSucceededEvent
OnSuccessPreloadRequestcontentRequestPreloadSucceededEvent
OnWillDisplayContentcontentWillDisplayEvent