The marketing API allows you to handle promotional features such as subscribing the user to your game's newsletters.
At the moment, this API only provides the newsletter feature.
All the methods of this API are accessible via the heyVR.marketing
object, which is made accessible to your game automatically.
Please notice, users can also decide to subscribe to a newsletter or follow a game or developer manually. This is done via the game or developer's page.
To avoid any complications, all the subscriptions that are initiated by the developers (via the SDK) will be marked as so, to prevent any sort of SDK mis-use.
You can subscribe a user to a specific game's newsletters. This way, you can track which user has subscribed to which game.
To do so, simply call the following method:
heyVR.marketing.subscribeToGame() : Promise<true>;
Promise
that resolve to true if the action is successful, or rejected in case of network failure.To unsubscribe a previously subscribed user from a newsletter, you can call the following method:
heyVR.marketing.unsubscribeFromGame() : Promise<true>;
The user does not need to be subscribe to the game before calling this method, so you can safely call it regarless of the subscription status.
Promise
that resolve to true if the action is successful, or rejected in case of network failure.Perhaps you need a toggle button in your code to subscribe/unsubscribe a user from a game's newsletter. You can do so by calling the following method:
heyVR.marketing.toggleGameSubscription() : Promise<Boolean>;
By using this method you will also have access to the user's subscription status.
Promise
that resolve to true if the user was already subscribed, or false if the user was not already subscribed and is now subscribed. Rejected in case of network failure.In addition to subscribing to a single game, a developer can choose to subscribe a user to their organization. This way you can ask the user's consent to send them newsletters regarding all of your games, updates, news and so on.
The methods are fairly similar to the game newsletter. To subscribe a user to your organization's newsletter, call the method below:
heyVR.marketing.subscribeToDeveloper() : Promise<true>;
Promise
that resolve to true if the action is successful, or rejected in case of network failure.To unsubscribe a user from your organization's newsletter, call the following method:
heyVR.marketing.unsubscribeFromDeveloper() : Promise<true>;
Promise
that resolve to true if the action is successful, or rejected in case of network failure.To toggle the subscription status of a users to your organization, you can call the following method:
By using this method you will also have access to the user's subscription status.
heyVR.marketing.toggleDeveloperSubscription() : Promise<Boolean>;
Promise
that resolve to true if the user was already subscribed, or false if the user was not already subscribed and is now subscribed. Rejected in case of network failure.