Application.php
1 year ago
ApplicationCollection.php
1 year ago
BaseObject.php
1 year ago
Campaign.php
1 year ago
CampaignCapping.php
1 year ago
CampaignCollection.php
1 year ago
CampaignSchedule.php
1 year ago
CampaignSchedulePressure.php
1 year ago
CampaignScheduleUrlCriterion.php
1 year ago
CampaignStats.php
1 year ago
CampaignSuccessResponse.php
1 year ago
CampaignUrlFilters.php
1 year ago
Collection.php
1 year ago
DeliveriesCreateResponse.php
1 year ago
Event.php
1 year ago
FrequentFieldValues.php
1 year ago
GeoLocation.php
1 year ago
Installation.php
1 year ago
InstallationApplication.php
1 year ago
InstallationApplicationApple.php
1 year ago
InstallationCollection.php
1 year ago
InstallationDevice.php
1 year ago
InstallationDeviceCapabilities.php
1 year ago
InstallationDeviceConfiguration.php
1 year ago
InstallationPreferences.php
1 year ago
InstallationPushToken.php
1 year ago
Notification.php
1 year ago
NotificationAlert.php
1 year ago
NotificationAlertAndroid.php
1 year ago
NotificationAlertAndroidButton.php
1 year ago
NotificationAlertIos.php
1 year ago
NotificationAlertIosAttachment.php
1 year ago
NotificationAlertIosForeground.php
1 year ago
NotificationAlertWeb.php
1 year ago
NotificationAlertWebButton.php
1 year ago
NotificationButton.php
1 year ago
NotificationButtonAction.php
1 year ago
NotificationButtonActionEvent.php
1 year ago
NotificationInApp.php
1 year ago
NotificationInAppButton.php
1 year ago
NotificationInAppMap.php
1 year ago
NotificationInAppMapPlace.php
1 year ago
NotificationPush.php
1 year ago
NotificationPushAndroid.php
1 year ago
NotificationPushIos.php
1 year ago
NotificationPushWeb.php
1 year ago
NullObject.php
1 year ago
Pagination.php
1 year ago
Segment.php
1 year ago
SegmentCollection.php
1 year ago
SuccessResponse.php
1 year ago
User.php
1 year ago
WebSdkInitOptions.php
1 year ago
WebSdkInitOptions.php
310 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WonderPush\Obj; |
| 4 | |
| 5 | if (count(get_included_files()) === 1) { http_response_code(403); exit(); } // Prevent direct access |
| 6 | |
| 7 | class WebSdkInitOptions extends BaseObject { |
| 8 | |
| 9 | /** @var string */ |
| 10 | private $applicationName; |
| 11 | /** @var string */ |
| 12 | private $applicationServerKey; |
| 13 | /** @var string */ |
| 14 | private $customDomain; |
| 15 | /** @var string */ |
| 16 | private $notificationDefaultUrl; |
| 17 | /** @var string */ |
| 18 | private $notificationIcon; |
| 19 | /** @var string */ |
| 20 | private $manifestUrl; |
| 21 | /** @var bool */ |
| 22 | private $resubscribe; |
| 23 | |
| 24 | /** @var array */ |
| 25 | private $allowedSubscriptionDomains; |
| 26 | /** @var mixed */ |
| 27 | private $subscriptionNative; |
| 28 | /** @var mixed */ |
| 29 | private $subscriptionDialog; |
| 30 | /** @var mixed */ |
| 31 | private $subscriptionBell; |
| 32 | /** @var mixed */ |
| 33 | private $subscriptionBlurb; |
| 34 | /** @var mixed */ |
| 35 | private $optInOptions; |
| 36 | /** @var mixed */ |
| 37 | private $plugins; |
| 38 | /** @var string */ |
| 39 | private $serviceWorkerUrl; |
| 40 | /** @var string */ |
| 41 | private $frameUrl; |
| 42 | |
| 43 | /** |
| 44 | * @return string |
| 45 | */ |
| 46 | public function getApplicationName() { |
| 47 | return $this->applicationName; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @param string $applicationName |
| 52 | * @return WebSdkInitOptions |
| 53 | */ |
| 54 | public function setApplicationName($applicationName) { |
| 55 | $this->applicationName = $applicationName; |
| 56 | return $this; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @return string |
| 61 | */ |
| 62 | public function getApplicationServerKey() { |
| 63 | return $this->applicationServerKey; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @param string $applicationServerKey |
| 68 | * @return WebSdkInitOptions |
| 69 | */ |
| 70 | public function setApplicationServerKey($applicationServerKey) { |
| 71 | $this->applicationServerKey = $applicationServerKey; |
| 72 | return $this; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @return string |
| 77 | */ |
| 78 | public function getCustomDomain() { |
| 79 | return $this->customDomain; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * @param string $customDomain |
| 84 | * @return WebSdkInitOptions |
| 85 | */ |
| 86 | public function setCustomDomain($customDomain) { |
| 87 | $this->customDomain = $customDomain; |
| 88 | return $this; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * @return string |
| 93 | */ |
| 94 | public function getNotificationDefaultUrl() { |
| 95 | return $this->notificationDefaultUrl; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * @param string $notificationDefaultUrl |
| 100 | * @return WebSdkInitOptions |
| 101 | */ |
| 102 | public function setNotificationDefaultUrl($notificationDefaultUrl) { |
| 103 | $this->notificationDefaultUrl = $notificationDefaultUrl; |
| 104 | return $this; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * @return string |
| 109 | */ |
| 110 | public function getNotificationIcon() { |
| 111 | return $this->notificationIcon; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * @param string $notificationIcon |
| 116 | * @return WebSdkInitOptions |
| 117 | */ |
| 118 | public function setNotificationIcon($notificationIcon) { |
| 119 | $this->notificationIcon = $notificationIcon; |
| 120 | return $this; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * @return string |
| 125 | */ |
| 126 | public function getManifestUrl() { |
| 127 | return $this->manifestUrl; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * @param string $manifestUrl |
| 132 | * @return WebSdkInitOptions |
| 133 | */ |
| 134 | public function setManifestUrl($manifestUrl) { |
| 135 | $this->manifestUrl = $manifestUrl; |
| 136 | return $this; |
| 137 | } |
| 138 | |
| 139 | public function getByWonderPushDomain() { |
| 140 | $customDomain = $this->getCustomDomain(); |
| 141 | if (!$customDomain) return null; |
| 142 | if (strpos($customDomain, 'http://') !== 0 |
| 143 | && strpos($customDomain, 'https://') !== 0) { |
| 144 | return $customDomain; |
| 145 | } |
| 146 | return null; |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * @return bool |
| 151 | */ |
| 152 | public function getResubscribe() { |
| 153 | return $this->resubscribe !== false; // A missing value means "true" |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * @param bool $resubscribe |
| 158 | * @return WebSdkInitOptions |
| 159 | */ |
| 160 | public function setResubscribe($resubscribe) { |
| 161 | $this->resubscribe = $resubscribe !== false; |
| 162 | return $this; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @return array |
| 167 | */ |
| 168 | public function getAllowedSubscriptionDomains() { |
| 169 | return $this->allowedSubscriptionDomains; |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * @param array $allowedSubscriptionDomains |
| 174 | * @return WebSdkInitOptions |
| 175 | */ |
| 176 | public function setAllowedSubscriptionDomains($allowedSubscriptionDomains) { |
| 177 | $this->allowedSubscriptionDomains = $allowedSubscriptionDomains; |
| 178 | return $this; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * @return mixed |
| 183 | */ |
| 184 | public function getSubscriptionNative() { |
| 185 | return $this->subscriptionNative; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * @param mixed $subscriptionNative |
| 190 | * @return WebSdkInitOptions |
| 191 | */ |
| 192 | public function setSubscriptionNative($subscriptionNative) { |
| 193 | $this->subscriptionNative = $subscriptionNative; |
| 194 | return $this; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * @return mixed |
| 199 | */ |
| 200 | public function getSubscriptionDialog() { |
| 201 | return $this->subscriptionDialog; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * @param mixed $subscriptionDialog |
| 206 | * @return WebSdkInitOptions |
| 207 | */ |
| 208 | public function setSubscriptionDialog($subscriptionDialog) { |
| 209 | $this->subscriptionDialog = $subscriptionDialog; |
| 210 | return $this; |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * @return mixed |
| 215 | */ |
| 216 | public function getSubscriptionBell() { |
| 217 | return $this->subscriptionBell; |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * @param mixed $subscriptionBell |
| 222 | * @return WebSdkInitOptions |
| 223 | */ |
| 224 | public function setSubscriptionBell($subscriptionBell) { |
| 225 | $this->subscriptionBell = $subscriptionBell; |
| 226 | return $this; |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * @return mixed |
| 231 | */ |
| 232 | public function getSubscriptionBlurb() { |
| 233 | return $this->subscriptionBlurb; |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * @param mixed $subscriptionBlurb |
| 238 | * @return WebSdkInitOptions |
| 239 | */ |
| 240 | public function setSubscriptionBlurb($subscriptionBlurb) { |
| 241 | $this->subscriptionBlurb = $subscriptionBlurb; |
| 242 | return $this; |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * @return mixed |
| 247 | */ |
| 248 | public function getOptInOptions() { |
| 249 | return $this->optInOptions; |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * @param mixed $optInOptions |
| 254 | * @return WebSdkInitOptions |
| 255 | */ |
| 256 | public function setOptInOptions($optInOptions) { |
| 257 | $this->optInOptions = $optInOptions; |
| 258 | return $this; |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * @return mixed |
| 263 | */ |
| 264 | public function getPlugins() { |
| 265 | return $this->plugins; |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * @param mixed $plugins |
| 270 | * @return WebSdkInitOptions |
| 271 | */ |
| 272 | public function setPlugins($plugins) { |
| 273 | $this->plugins = $plugins; |
| 274 | return $this; |
| 275 | } |
| 276 | |
| 277 | /** |
| 278 | * @return string |
| 279 | */ |
| 280 | public function getServiceWorkerUrl() { |
| 281 | return $this->serviceWorkerUrl; |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * @param string $serviceWorkerUrl |
| 286 | * @return WebSdkInitOptions |
| 287 | */ |
| 288 | public function setServiceWorkerUrl($serviceWorkerUrl) { |
| 289 | $this->serviceWorkerUrl = $serviceWorkerUrl; |
| 290 | return $this; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * @return string |
| 295 | */ |
| 296 | public function getFrameUrl() { |
| 297 | return $this->frameUrl; |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * @param string $frameUrl |
| 302 | * @return WebSdkInitOptions |
| 303 | */ |
| 304 | public function setFrameUrl($frameUrl) { |
| 305 | $this->frameUrl = $frameUrl; |
| 306 | return $this; |
| 307 | } |
| 308 | |
| 309 | } |
| 310 |