Skip to content

A Cordova iOS plugin that detects if an app was installed via TestFlight or launched from XCode

Notifications You must be signed in to change notification settings

Arcticus/Cordova-Plugin---Test-Flight-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova TestFlight Detector Plugin

Plugin's Purpose

The purpose of the plugin is to create a method for Cordova based iOS applications to determine at runtime whether an application was installed via the Apple App Store or as a beta app via TestFlight or launched from XCode to an attached USB device or iOS Simulator. This allows a developer to use a single build and exercise separate code for testing versus production.

com.gosyntactix.cordova.testflightdetector

This plugin defines a global TFDetect object, which on app launch queries whether an app was installed via TestFlight or launched from XCode. The launch from XCode works for both the Simulator and an attached USB device.

Although the object is in the global scope, it is not available until after the deviceready event.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    console.log(TFDetect.isRunningTestFlightBeta);
}

Installation

cordova plugin add com.gosyntactix.cordova.testflightdetector

Properties

  • TFDetect.isTFXC
  • TFDetect.isAppStore

TFDetect.isRunningTestFlightBeta

Returns true if the app was installed via TestFlight or launched from XCode to an attached USB device or iOS Simulator. Returns false if the app was installed via the official Apple App Store.

Supported Platforms

  • iOS

Quick Example

if (TFDetect.isTFXC) {
	//DEBUG CODE HERE
} else {
	//PRODUCTION CODE HERE
}

TFDetect.isAppStore

Returns true if the app was installed via the Apple App Store. Returns false if the app was installed via TestFlight or launched from XCode to an attached USB device or iOS Simulator.

Supported Platforms

  • iOS

Quick Example

if (TFDetect.isAppStore) {
	//PRODUCTION CODE HERE
} else {
	//DEBUG CODE HERE
}

About

A Cordova iOS plugin that detects if an app was installed via TestFlight or launched from XCode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published