Skip to content

New updated Unity SDK documentation #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

PythonHackerr
Copy link

Unity SDK documentation

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ❌ Failed (Inspect) Dec 9, 2024 4:11pm

Copy link

vercel bot commented Dec 9, 2024

@PythonHackerr is attempting to deploy a commit to the Radar Team on Vercel.

A member of the Team first needs to authorize it.


# Unity wrapper SDK

This is the documentation for the Unity wrapper/plugin, which provides a thin proxy layer for integrating existing native SDKs offering location tracking and geofencing services. Before integrating, review the native SDK documentation for iOS and Android to understand platform-specific requirements and features.
Copy link
Contributor

@KennyHuRadar KennyHuRadar Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We normally also include a link like such

Before integrating, read the [native SDK documentation](/sdk) to familiarize yourself with the platform.

We should also add the unity icon to the sdk page
image


Scripts documentation and Demo scene overview can be found in project READMEs.

## Install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we are not able to simply provide a .unitypackage file so that developers can simply add the required assets by double clicking the .unitypackage from inside unity?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can and we should, I will create it and publish to the repo


To integrate the Unity SDK, download or clone the package and include it in your Unity project:

1. Copy the `Plugins` folder (containing both Android and iOS native implementations) into the `Assets` directory of your Unity project. Ensure it contains all the required files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Ensure it contains all the required files. feels extraneous

To integrate the Unity SDK, download or clone the package and include it in your Unity project:

1. Copy the `Plugins` folder (containing both Android and iOS native implementations) into the `Assets` directory of your Unity project. Ensure it contains all the required files.
2. Import the ExternalDependencyManager for Unity (EDM4U). It is included in the project but you can get it from `Package Manager` or from [repo](https://github.com/googlesamples/unity-jar-resolver): It is required if you want to add and use iOS/Android dependencies directly in your project like: `Android specific libraries (e.g AARs)` or `iOS CocoaPods`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we say ExternalDependencyManager instead of ExternalDependencyManager?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should!


1. Copy the `Plugins` folder (containing both Android and iOS native implementations) into the `Assets` directory of your Unity project. Ensure it contains all the required files.
2. Import the ExternalDependencyManager for Unity (EDM4U). It is included in the project but you can get it from `Package Manager` or from [repo](https://github.com/googlesamples/unity-jar-resolver): It is required if you want to add and use iOS/Android dependencies directly in your project like: `Android specific libraries (e.g AARs)` or `iOS CocoaPods`
3. Ensure that any required permissions or settings specific to location tracking and geofencing are configured on both iOS and Android, as outlined in the native SDK documentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets link to the corresponding sections within native SDK documentation here.


### Calls to APIs

The Unity SDK exposes following APIs calls:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe having a comma separated list is the best way to index our api calls, maybe a codebox with pseudo code in a class format looks better? Like the C# version of

RadarSDK {
initialize
...
}

And also since we already describe the calls below, do we even need to list them out here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, no need to list them out


#### GetVerifiedLocationToken

Once the native SDK retrieves the location, it sends the data back to Unity. On Android, this is done via RadarJavaProxy, and on iOS, it’s done via a delegate or callback defined in RadarUnityBridge.m
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should either have a descriptions for all api calls or for none of them for consistency.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add some short descriptions that make sense to all functions

```csharp
try
{
Radar.SomeFunctionality();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use a real call here

package.json Outdated
@@ -49,6 +49,7 @@
"@types/react": "^17.0.11",
"@types/react-helmet": "^6.1.1",
"@types/react-router-dom": "^5.1.7",
"cross-env": "^7.0.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we using cross env? is this just a local dev dependency you need?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not need this. Perhaps I added this when I tried to fix some issues. I will delete it and test everything.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it, I cannot preview. I get this error:

$ npm run start

> [email protected] start
> NODE_OPTIONS=--openssl-legacy-provider docusaurus start

'NODE_OPTIONS' is not recognized as an internal or external command,
operable program or batch file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, are you working on a windows PC?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this? is this also related to the cross-env?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious on why do we need to add this new file into the repository, this wasn't previously here.

@KennyHuRadar
Copy link
Contributor

The preview is not building, I suspect that there may be an issue with the new files you created. I am guessing that you need these files to build the file for you but they are breaking the actual deployment build process. Can you remove those file diffs from this PR, you can obviously keep those on your local copy of the repo but I think we don't want to merge them in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants