Giter Club home page Giter Club logo

unity_android_ios_app_detection's Introduction

Unity Android and iOS App Detection Plugin

Unity Android and iOS Ability to Detect if a specific app has been installed

Download the Unity Package Here

Checking if an App is installed

To check if an app is installed first you need to initilize the app with

GetAppInfo appCheck = new GetAppInfo();

To Check if an app is installed call CheckInstalledApp(string APPID)

Android and iOS have different ways of checking if an Application is installed Follow the Guides bellow to make sure you have everything setup to check for the installed apps

Checking Android Apps

Due to recent changes with Android Permissions, how we check for apps installed on Android has been made more complicated. You need to request permission to query specific packages, or request permission to query all packages.

This is both a priviacy concern and out of scope for this project. So you will first need to download the Android Studio Project NetworkCheck which can be found here.

In the AppCheck project you will need to add the query as stated in the Android Documentation here

Build the AppCheck as an aar, and add it to your project in ./Assets/Plugins/Android

To Check for an Android App you will need to the Package Name for the app, i.e. com.android.Chrome for Google Chrome

Look at CheckInstalledApp.cs for an example of this

Checking iOS Apps

On iOS App checking is a lot more complicated since there is no Package Manager. So there is no way to check to see if an app is actually installed. But there is a workaround.

THIS WILL NOT WORK ON IOS 9 or LOWER

How the 16 Bit Unity App Detection on iOS works is by checking if there is an App installed which can open a specific web link.

The code for this is located in AppCheck.mm in ./Assets/Plugins/iOS

For example if you were to open a facebook link on Safari, Safari might open the Facebook app is it is installed.

So what you need to do is add the ability to open your app with a unique weblink which to my knowledge cannot be done in Unity but I could be wrong.

  1. Get the URL's for the Applications you want to search for or make up your own

    • We can add the ability to search for your app but you need to think for Unique URL's for your apps, i.e. MyCoolApp
    • For Third Party Apps try Google but I cannot guarentee if they would have them
  2. Add you checks to your code and build your App to Xcode

    • In Xcode we can add the attributes for the App Sensing
  3. Add The Following to your Info.plist

If you want your app to be detected add the Following

<key>CFBundleURLTypes</key>
<array>
  <dict>
	  <key>CFBundleURLSchemes</key>
		<array>
		  <string>INSERT_URL_WHICH_THE_APP_CAN_REACT_TO_HERE</string>
		</array>
		<key>CFBundleURLName</key>
		  <string>INSERT_APP_ID_HERE</string>
	</dict>
</array>

INSERT_URL_WHICH_THE_APP_CAN_REACT_TO_HERE can be anything like APP00 or MyCoolApp just so long as it would work as a url

INSERT_APP_ID_HERE is your application bundle ID I use com.CompanyName.${PRODUCT_NAME} for my apps

If you want to detect other apps

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>App00</string>
        <string>App01</string>
        <string>App(n-1)</string>
    </array>

Just change the App00 and so on to whatever you need to check for.

unity_android_ios_app_detection's People

Contributors

the16bitgamer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

angryera

unity_android_ios_app_detection's Issues

How to find value of AppToCheckiOS?

In file CheckInstalledApp.cs, in line 14:
public string AppToCheckiOS = "SixteenBitApp00";
I don't know where to find out "SixteenBitApp00". For example, If I want to check if another app such as Youtube, Twitter, ect. was installed, can you tell me how to find the value for that string AppToCheckiOS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.