Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattsparks/appstoreredirect
Redirect your users to your app in the appropriate app store.
https://github.com/mattsparks/appstoreredirect
android-app app apple appstore google-play-store ios ios-app redirect
Last synced: about 1 month ago
JSON representation
Redirect your users to your app in the appropriate app store.
- Host: GitHub
- URL: https://github.com/mattsparks/appstoreredirect
- Owner: mattsparks
- License: mit
- Created: 2018-02-07T17:04:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T23:42:52.000Z (almost 7 years ago)
- Last Synced: 2024-10-02T03:02:13.506Z (about 1 month ago)
- Topics: android-app, app, apple, appstore, google-play-store, ios, ios-app, redirect
- Language: PHP
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# App Store Redirect
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+.
## Install
Via composer:
```bash
composer require mattsparks/appstoreredirect
```## Example Usage
```php
[
'iOS' => [
'path' => 'https://itunes.apple.com/us/app/example-app-name/id1234567890',
'message' => 'Sending you to the Apple App Store',
],
'androidos' => [
'path' => 'https://play.google.com/store/apps/details?id=com.example.app',
'message' => 'Sending you to the Google Play Store',
],
],
'delay' => 5,
'fallback' => [
'path' => 'http://example.com',
],
];$redirect = new AppStoreRedirect($config);
$redirect->run();
```## Configuration
| 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](https://github.com/serbanghita/Mobile-Detect) to determine the platform being used. I've only tested iOS and Android so far and can only vouch for those.
## Contribute
Contributions are very welcome!1. Follow the [PSR-2 Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
2. Create a feature branch.
3. Send a pull request.