Skip to content

Commit

Permalink
Fix: iOS mobile app detection for iPad devices
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-farre committed Nov 6, 2024
1 parent 50c165a commit 087a742
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

2.1.1 (unreleased)
------------------------
- Fix: iOS mobile app detection for iPad devices

2.1.0 (October 21, 2024)
------------------------
- Fix #51: Firebase not working anymore for web push notifications
Expand Down
15 changes: 7 additions & 8 deletions helpers/MobileAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,13 @@ private static function sendFlutterMessage($msg)

public static function isIosApp()
{
$headers = Yii::$app->request->headers;

if (static::isAppRequest() &&
$headers->has('user-agent') &&
str_contains($headers->get('user-agent', '', true), 'iPhone')) {

return true;
}
return
static::isAppRequest()
&& Yii::$app->request->headers->has('x-humhub-app-is-ios')
&& !str_contains(
Yii::$app->request->headers->get('x-humhub-app-is-ios', '', true),
'1',
);
}

}
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"humhub": {
"minVersion": "1.14"
},
"version": "2.1.0",
"version": "2.1.1",
"screenshots": [
"resources/screenshot1.PNG",
"resources/screenshot2.PNG"
Expand Down

0 comments on commit 087a742

Please sign in to comment.