Redirect your users to your app in the appropriate app store.

dev-master 2018-02-07 23:42 UTC

This package is auto-updated.

Last update: 2024-02-24 04:31:30 UTC


Have an app that you need to direct your users to? Send them to the correct app store with this handy class. Requires PHP 7+.


Via composer:

composer require mattsparks/appstoreredirect

Example Usage

require __DIR__ . '/vendor/autoload.php';

use AppStoreRedirect\AppStoreRedirect;

$config = [
    'platforms' => [
        'iOS' => [
            'path' => '',
            'message' => 'Sending you to the Apple App Store',
        'androidos' => [
            'path' => '',
            'message' => 'Sending you to the Google Play Store',            
    'delay' => 5,
    'fallback' => [
        'path' => '',

$redirect = new AppStoreRedirect($config);


Option Values Description
platform iOS, androidos The platform being targeted. A path is required, message is optional.
delay 0 - ? Number of seconds to delay redirect. optional
fallback path A fallback path should a platform not be matched. optional

Note: Other platforms are likely supported. Under the hood this uses Mobile Detect to determine the platform being used. I've only tested iOS and Android so far and can only vouch for those.


Contributions are very welcome!

  1. Follow the PSR-2 Standard
  2. Create a feature branch.
  3. Send a pull request.