Recent Discussions
Unnecessary permission RECORD_AUDIO in Platform SDK for Unity
Recently my app got rejected with note: Your app is asking for excessive user permissions or using user permissions inappropriately. Here are all the permissions appearing in build info: android.permission.READ_EXTERNAL_STORAGE android.permission.INTERNET android.permission.WAKE_LOCK android.permission.ACCESS_NETWORK_STATE android.permission.RECORD_AUDIO android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_EXTERNAL_STORAGE At this point, RECORD_AUDIO permission is not required but its included because of MicrophoneInput.cs script under OculusPlatform/Scripts. If I remove this file and related files which use Unity's Microphone class and build the app, RECORD_AUDIO permission is gone. It makes sense to include this file in a project which actually uses Microphone at some point. But I am never gonna need it. Shall I remove this file and related files (IMicrophone.cs, MicrophoneInputNative.cs)? Are there any other files in Platform SDK which should be removed to avoid bugs due to code dependency? Please advice me how to fix this ThanksUmairEm4 years agoExplorer3likes25CommentsUpload failed- copy of Oculus Platform Command Line Utility is old. permission restricted by Oculus
Recently, I changed my laptop from Mac to Window. Original Unity version installed in my Mac was 2021.2. However, when I got my new laptop, I can only install 2021.3.4f1. I backed up all of my files, the whole folder from Mac. Currently, I can finally build my original project on Unity 2021.3. When I tried to upload my modified app through ODH, it shows 022-06-27T12:30:20.091Z [DEBUG] Run args: {"appId":508*****719*****,"apkPath":"D:\\Unity Project\\MyProject\\MyProject_v2.0.apk","channel":"ALPHA","draft":false,"excludeAddons":false,"inheritAssetFiles":false,"isODH":true,"token":"(removed)","uploadConcurrency":null,"platform":"ANDROID_6DOF"} 2022-06-27T12:30:20.382Z [DEBUG] ******************************************************************************* * Your copy of Oculus Platform Command Line Utility is old. * * Version 1.76.0.000001 has been released on Fri Jun 24 2022. * * Please use the following command to update it: * * > ..\..\Users\bette\AppData\Roaming\odh\ovr-platform-util.exe self-update * ******************************************************************************* 2022-06-27T12:30:20.383Z [DEBUG] Server log: {"app_id":5081216671915741,"log_level":"DEBUG","event_name":"COMMAND_PARAMS","stack_trace":"at Object._log (C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js)\nat Object.debug (C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js)\nat C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js\nat processTicksAndRejections (node:internal/process/task_queues:96:5)\nat async C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js","extra":"{\"appId\":5081216671915741,\"apkPath\":\"D:\\\\Unity Project\\\\MyProject\\\\MyProject\_v2.0.apk\",\"channel\":\"ALPHA\",\"draft\":false,\"excludeAddons\":false,\"inheritAssetFiles\":false,\"isODH\":true,\"token\":\"(removed)\",\"uploadConcurrency\":null,\"platform\":\"ANDROID_6DOF\",\"os\":\"{\\\"platform\\\":\\\"win32\\\",\\\"arch\\\":\\\"x64\\\",\\\"type\\\":\\\"Windows_NT\\\"}\",\"cli_version\":\"1.76.0.000001\",\"compatibility_version\":2,\"app_id\":508*****719*****,\"session_id\":\"508*****719*****-06-27T12:30:20.382Z\"}"} 2022-06-27T12:30:20.685Z [DEBUG] Validating build... 2022-06-27T12:30:21.503Z [DEBUG] NOTE: Your manifest includes the following permissions restricted by Oculus: - android.permission.RECORD_AUDIO - android.permission.MODIFY_AUDIO_SETTINGS Please remove these permissions if they are not needed by your application. If they are needed, you must include justification in the “Notes for the Reviewer” field when submitting your application for review. Failure to provide justification will result in the rejection of your application. APK is debuggable (android:debuggable in AndroidManifest.xml). NOTE: you may only distribute debuggable APKs through private channels. 2022-06-27T12:30:21.503Z [DEBUG] Preparing for upload... 2022-06-27T12:30:21.810Z [DEBUG] Server log: {"app_id":5081216671915741,"log_level":"DEBUG","event_name":"UPLOAD_CONFIG","stack_trace":"at Object._log (C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js)\nat Object.debug (C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js)\nat C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js\nat processTicksAndRejections (node:internal/process/task_queues:96:5)\nat async C:\\snapshot\\boxes\\C_ZcygwinZdataZsandcastleZboxesZtrunk-hg-full-fbsource\\edenfs\\redirections\\arvr\\js\\temp\\build-ovr-platform-util\\lib\\ovr_platform_util.js","extra":"{\"response\":{\"latest_binary_id\":\"5143786292325445\",\"latest_binary_rdiff_signature_uri\":\"https://securecdn.oculus.com/binaries/rdiff-signatures/?binary_id=5143786292325445\",\"has_shared_asset_files\":false},\"time\":306,\"os\":\"{\\\"platform\\\":\\\"win32\\\",\\\"arch\\\":\\\"x64\\\",\\\"type\\\":\\\"Windows_NT\\\"}\",\"cli_version\":\"1.76.0.000001\",\"compatibility_version\":2,\"app_id\":508*****719*****,\"platform\":\"ANDROID_6DOF\",\"session_id\":\"508*****719*****-06-27T12:30:20.382Z\"}"} 2022-06-27T12:30:21.810Z [DEBUG] Uploading APK... 2022-06-27T12:30:21.811Z [DEBUG] Downloading signature of previous build I tried to update foloowing the instruction, however, it showed I am already running the latest version. "C:\Users\bette\AppData\Roaming\odh>ovr-platform-util.exe self-update Logs are written to: C:\Users\bette\AppData\Local\Temp\oc_cli__2022-06-27T12-32-17-484Z.log Checking for the latest version Already running the latest version 1.76.0.000001" As for the following permissions restricted by Oculus: - android.permission.RECORD_AUDIO - android.permission.MODIFY_AUDIO_SETTINGS I googled and tried to removed them, it is not working. Can anyone help guide me to fix this issue?weberwu4 years agoHonored Guest0likes1CommentUnity IAP Tutorial
I've seen a lot of people ask about how to do IAP in Unity, so I thought I'd share some pseudo-code for how to do it. 1) Create an organization/app through the Oculus developer dashboard. Once you have done that, go to the API tab and find your AppID. Now click on generate user token. You'll need both of these keys to configure and test in Unity. 2) You'll also need to configure the available IAP skus through the developer dashboard. From your app on the dashboard, click the platform tab. You'll need to upload a tab separated file that contains all the information such as sku name, description, price, etc. You can edit the provided template as necessary. 3) Download the Platform SDK and added the provided Unity framework to your project. You should now see a menu item for Oculus Platform, and under it Edit Settings. Provide the AppID in the Rift or GearVR section, depending on your app type. If you plan on testing from the Unity Editor, you should also provide a user token 4) Unity should now be configured, and you can start coding. The first thing you need to do is initialize the platform. You do this by making the following function call: Oculus.Platform.Core.Initialize(); If you did not enter your AppID through the Unity editor, you can also pass it in to this function, such as: Oculus.Platform.Core.Initialize("<your app id here>"); Once initialized, you can make other calls to the Platform SDK. The Platform SDK code uses a callback system. You call the Platform function and provide the name of the callback function that should be triggered when the Platform function is done processing. For example, say you want to make sure that the user is Entitled to your application (i.e. they have purchased it). You would use the Oculus.Platform.Entitlements.IsUserEntitledToApplication() function for that. public void CheckApplicationEntitlement() { // Call the entitlement check function and give it the function to call when it's done Oculus.Platform.Entitlements.IsUserEntitledToApplication().OnComplete(IsUserEntitledToApplicationCallback); } In this case, I specify that the Platform should should call my IsUserEntitledToApplicationCallback function when IsUserEntitledToApplication is complete. void IsUserEntitledToApplicationCallback(Message msg) { // If msg.IsError is true, then the user is not entitled to the app if (!msg.IsError) { mApplicationEntitled = true; } else { //Debug.Log("Application is NOT entitled."); mApplicationEntitled = false; } } The rest of the IAP relate calls work the same way. There are three IAP related calls you might want to make. 1) See what products are available for purchase 2) See what products a user has already purchased 3) Initiate a new purchase Let's look at each of these. Available Products public void RetrieveProducts() { // Now retrieve products for the listed skus string[] skus = { "sku 1", "sku 2", "sku 3"}; IAP.GetProductsBySKU(skus).OnComplete(GetProductsBySKUCallback); } void GetProductsBySKUCallback(Message msg) { if (!msg.IsError) { ProductList products = msg.GetProductList(); // Update the entitlements object foreach (Product p in products) { //Debug.Log("Product " + p.Sku + " is available for purchase for " + p.FormattedPrice + "."); // You might want to save this sku and it's price for display somewhere else in your app. A Dictionary is a good choice for this } } else { Error e = msg.GetError(); Debug.Log("GetProductsBySKUCallback Error code: " + e.Code + " http: " + e.HttpCode + " msg: " + e.Message); } } Purchased Products public void RetrievePurchases() { Debug.Log("Retrieve Purchases called"); IAP.GetViewerPurchases().OnComplete(GetViewerPurchasesCallback); } void GetViewerPurchasesCallback(Message msg) { if (!msg.IsError) { // Get the list of products purchased by the uer PurchaseList purchasedProducts = msg.GetPurchaseList(); foreach (Purchase p in purchasedProducts) { Debug.Log("Purchase " + p.Sku + " is owned by user."); // Do something with this knowledge, perhaps by saving entitlements to a file or for updating app state } } else { Error e = msg.GetError(); Debug.Log("GetViewerPurchasesCallback Error code: " + e.Code + " http: " + e.HttpCode + " msg: " + e.Message); } } Initiate Purchase There is one thing to note about initiating a purchase. It will NOT work from the Unity Editor. You need to make a real build to get the purchase to initiate. For this reason, it is important that for you to create test users from the developer dashboard. public void InitiatePurchase(string sku) { // For testing within the Unity Editor, I highly recommend you short-circuit your IAP callback flow in some way that your user is simply granted access to the purchase if (Debug.isDebugBuild) { // Call some function to just grant the entitlement to the IAP } else IAP.LaunchCheckoutFlow(sku).OnComplete(LaunchCheckoutFlowCallback); } } void LaunchCheckoutFlowCallback(Message msg) { if (!msg.IsError) { Purchase p = msg.GetPurchase(); Debug.Log("User purchased " + p.Sku + "."); // Call your code to grant the user the IAP } else { Error e = msg.GetError(); Debug.Log("LaunchCheckoutFlowCallback Error code: " + e.Code + " http: " + e.HttpCode + " msg: " + e.Message); } } 5) Testing IAP The final step is testing an actual in-app purchase. Once you have created test users, you'll need to add them to your build's test channel. Getting access to the test channels requires Oculus to enable something for you, so message cybereality. Once that is done, make a build and upload it to through the developer dashboard to the alpha/beta/rc channel. Add your test users to the channel. You will need to login to Oculus Home with a test user. Once there, add one of the test credit cards listed in the OVRPlatform docs. You should now have access to your build from within Oculus Home and can test that your IAP works properly.delphinius814 years agoRising Star3likes23CommentsIs it a bug that fail immediate reconnection with UE4 and OnlineSubsystemOculus?
Is this a bug in OnlineSubsystemOculus? Steps to Reproduce 1. Create new project with OnlineSubsystemOculus. 2. Set project to CreateSession when c is pressed, JoinSession to the first Session found by FindSession when j is presssed,QuitGame when ESC is pressed. 3. Create windows package and place it on a separate windows PC. 4. Play with the sever side and press c to CreateSession. 5. Play with the client side and press j to JoinSession. 6. Press ESC to QuitGame if JoinSession succeeds on the client side. 7. Immediately press j on client side to recconect. Results Occasionally, JoinSession succeeds but connection fails with PendingConnectionFailure. Expected Connection succeeds. Description If the connection fails, the server logs the following. [2020.01.31-05.58.18:173][ 56]LogNet: Verbose: 1433034680154146 changed network connection state [2020.01.31-05.58.18:173][ 56]LogNet: Warning: Cannot reopen a closed connection to 1433034680154146 If the connection fails, The following server log is recorded when disconnecting the previous connection. [2020.01.31-05.57.57:206][909]LogNet: UChannel::CleanUp: ChIndex == 0. Closing connection. [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 1433034680154146.oculus, Name: OculusNetConnection_2147482424, Driver: GameNetDriver OculusNetDriver_2147482539, IsServer: YES, PC: PlayerController_2147482420, Owner: PlayerController_2147482420, UniqueId: Oculus:ovrID:1433034680154146 [2020.01.31-05.57.57:206][909]LogNet: Verbose: UNetConnection::SetClientLoginState: State changing from ReceivedJoin to CleanedUp If the connection succeeds, the following server log recorded when disconnecting the previous connection. [2020.01.31-05.57.29:442][756]LogNet: UChannel::CleanUp: ChIndex == 0. Closing connection. [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 1433034680154146.oculus, Name: OculusNetConnection_2147482453, Driver: GameNetDriver OculusNetDriver_2147482539, IsServer: YES, PC: PlayerController_2147482449, Owner: PlayerController_2147482449, UniqueId: Oculus:ovrID:1433034680154146 [2020.01.31-05.57.29:442][756]LogNet: Verbose: UNetConnection::SetClientLoginState: State changing from ReceivedJoin to CleanedUp [2020.01.31-05.57.38:324][ 88]LogNet: Verbose: UNetConnection::SetClientLoginState: State same: CleanedUp When the connection is successful, "UNetConnection::SetClientLoginState: State same: CleanedUp" is recorded when the previous connection is disconnected. Upon examination, it appeared that this log was being called by UOculusNetConnection::FinishDestroy. I think that if I connect before the previous Connection is destoried by garbage collect, the connection will fail. The following fix worked for me. diff --git a/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetConnection.h b/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetConnection.h index d482315..d0cc5bb 100644 --- a/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetConnection.h +++ b/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetConnection.h @@ -29,6 +29,7 @@ public: FString LowLevelGetRemoteAddress(bool bAppendPort = false) override; FString LowLevelDescribe() override; virtual void FinishDestroy() override; + virtual void CleanUp() override;^M virtual FString RemoteAddressToString() override; // End NetConnection Interface diff --git a/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetDriver.h b/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetDriver.h index b894646..158f5fa 100644 --- a/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetDriver.h +++ b/Plugins/Online/OnlineSubsystemOculus/Source/Classes/OculusNetDriver.h @@ -45,4 +45,6 @@ public: void OnNewNetworkingPeerRequest(ovrMessageHandle Message, bool bIsError); void OnNetworkingConnectionStateChange(ovrMessageHandle Message, bool bIsError); +^M + bool RemoveConnection(uint64 PeerID);^M }; diff --git a/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetConnection.cpp b/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetConnection.cpp index 880db83..f750de5 100644 --- a/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetConnection.cpp +++ b/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetConnection.cpp @@ -1,6 +1,7 @@ // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. #include "OculusNetConnection.h" +#include "OculusNetDriver.h"^M #include "OnlineSubsystemOculusPrivate.h" #include "IPAddressOculus.h" @@ -156,6 +157,21 @@ void UOculusNetConnection::FinishDestroy() } }+void UOculusNetConnection::CleanUp()^M +{^M + if (bIsPassThrough)^M + {^M + UIpConnection::CleanUp();^M + return;^M + }^M +^M + if (Driver != nullptr)^M + {^M + reinterpret_cast<UOculusNetDriver*>(Driver)->RemoveConnection(PeerID);^M + }^M + UNetConnection::CleanUp();^M +}^M +^M FString UOculusNetConnection::RemoteAddressToString() { if (bIsPassThrough) diff --git a/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp b/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp index ee5be0f..73a3789 100644 --- a/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp +++ b/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp @@ -513,3 +513,15 @@ bool UOculusNetDriver::IsNetResourceValid() // The clients need to wait until the connection is established before sending packets return ServerConnection->State == EConnectionState::USOCK_Open; } +^M +bool UOculusNetDriver::RemoveConnection(uint64 PeerID)^M +{^M + if (!Connections.Contains(PeerID))^M + {^M + UE_LOG(LogNet, Warning, TEXT("Connections doesn't have the PeerID"))^M + return false;^M + }^M +^M + Connections.Remove(PeerID);^M + return true;^M +}mechamount4 years agoExplorer1like5CommentsGet Achievement details in Unity
I can get a list of Achievements from Unity, along with the Player's progress. What about the achievement description, title and image fields? There appears to be no way of accessing those, except via curl with a server-to-server connection -- not really what I need. Am I missing something?David_Barlia4 years agoHonored Guest0likes3CommentsResetting Achievements
We have a Unity based game which is in QA at the moment and the testers have requested a feature which will allow them to reset their achievements through a debug menu in-game. I was looking at the API calls and there does not appear to be a way to reset or re-lock an achievement after it has been Unlocked. Is there a way to reset the achievements after they have been Unlocked?Wendall4 years agoExplorer1like6CommentsOculus mobile project outside of SDK directory
Hi, I have tried many things, but have not managed to get a pure Oculus Mobile project running outside of the SDK directory. There is a tool that creates a new project out of the VrTemplate directory, but it is simply put into the examples directory. That works fine, but if I try to move that out of there into a new directory it no longer works. Am I missing something, or am I maybe making some incorrect assumptions? I would have thought that one could take a project similar to one of the examples and have that as the project, point it to the Oculus Mobile SDK directory and compile it. Any help on that would be appreciated.tomee4 years agoExplorer1like8CommentsWhat are the pre-requisites to perform an App-To-App Deeplink with the Oculus Platform SDK?
I'm trying to integrate the new App-To-App Deeplink feature in the Oculus Platform SDK and I'm not sure what is required for this to work. var options = new ApplicationOptions(); var result = Oculus.Platform.Application.LaunchOtherApp(1257029974329451, options); //Launch Rec Room result returns null. So far I've tried editor and a standalone build (building for Rift). I've added my app id to the Platform SDK settings. Does my application need to be publicly available on the Oculus store before I can test it? Does it require the other app (in this case, Rec Room) to integrate the handler for App-To-App deeplinking?jelzonmonzon4 years agoHonored Guest0likes2CommentsApp Lab and Oculus API not working. "Error: Must call get_signature first (1971051)"
Does anyone know how to access the Oculus API for App Lab apps? In previous games I've published via Oculus, what I'd do is I'd upload a build to one of the ALPHA/BETA channels, and then add my Oculus account to it so that it was in my Oculus library. This way, when inside of Unity, I would be able to pull in Oculus API data. However, now with App Labs, there's no channels to upload to, and it seems like when I upload the build, it appears to be like I'm uploading it to be publicly available, but really I only want to upload it to a non-public channel so that I can continue my Oculus API integrations. (I'm not sure if this is true, but there's no indication when I submit my application if it will be public or private or unlisted). To provide some code context, I know this code snippet below works because when I put another App ID of another Oculus game I previously published, I'm able to grab Oculus API data (e.g. GetOrgScopedID()), but if I use my new Oculus App Lab App ID, I get this error in the console: error: Must call get_signature first (1971051) Here is the code that I run when the application starts. Reminder that this works when using a previously published App ID, but doesn't work with an App Lab App ID. void SignInToOculus() { Core.AsyncInitialize().OnComplete(message => { if (!message.IsError) { Users.GetLoggedInUser().OnComplete((msg) => { if (msg.IsError) { print("error: " + msg.GetError().Message); // error message above originates from here Invoke("InitializeOculusInfo", 10); } else { Users.GetOrgScopedID(msg.GetUser().ID).OnComplete((msg2) => { if (msg2.IsError) { print("error: " + msg2.GetError().Message); Invoke("InitializeOculusInfo", 10); } else { print("Logged in using Oculus"); } }); } }); } }); } Unity 2020.1.11f1 Oculus SDK can't seem to find the version number. If it's relevant, please let me know where to find this. Thank you in advance!lebolay4 years agoExplorer0likes1CommentOculus Quest is running Android 7.1(API level 25) while all documention and tools state using 8+
I'm currently able to build and run my game just fine using API 25, but all the documentation and and the lint tool suggest going to API 26+. When I install I get the INSTALL_FAILED_OLDER_SDK ... Requires newer sdk version #27 (current version is #25) error. It appears my device is up to date (333700.3780.0) but when I check the API version on the device(using adb shell getprop ro.build.version.sdk) it states 25. Doing this to all our devices gives the same result. I was wondering, are we missing something? Thanks using: Unity 2019.2.0f1 jdk 1.8.0_77-b03 ndk r16bm2-funomena4 years agoHonored Guest0likes3Comments