| @@ -216,9 +216,17 @@ | ||
| 216 | 216 | public function getPushSettings(Request $request) |
| 217 | 217 | { |
| 218 | 218 | $data = [ |
| 219 | 219 | 'push_settings' => Utility::getPushNotificationSettings(), |
| 220 | - 'push_available' => PushNotificationModule::isFluentNotifyActive() | |
| 220 | + 'push_available' => PushNotificationModule::isFluentNotifyActive(), | |
| 221 | + 'push_setup' => [ | |
| 222 | + 'state' => PushNotificationModule::getSetupState(), | |
| 223 | + 'settings_url' => PushNotificationModule::getSettingsUrl(), | |
| 224 | + 'can_install' => current_user_can('install_plugins'), | |
| 225 | + 'can_activate' => current_user_can('activate_plugins'), | |
| 226 | + 'has_installer' => (bool)has_action('fluent_community/install_fluent_notify_plugin'), | |
| 227 | + 'learn_more_url' => 'https://fluentnotify.com' | |
| 228 | + ] | |
| 221 | 229 | ]; |
| 222 | 230 | |
| 223 | 231 | return apply_filters('fluent_community/push_settings_api_response', $data, $request->all()); |
| 224 | 232 | } |