diff --git a/app/Http/routes.php b/app/Http/routes.php index 15f0b247a144..1785c18772ca 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -52,7 +52,7 @@ Route::group(['middleware' => 'auth:client'], function() { Route::get('client/documents/js/{documents}/{filename}', 'PublicClientController@getDocumentVFSJS'); Route::get('client/documents/{invitation_key}/{documents}/{filename?}', 'PublicClientController@getDocument'); Route::get('client/documents/{invitation_key}/{filename?}', 'PublicClientController@getInvoiceDocumentsZip'); - + Route::get('api/client.quotes', array('as'=>'api.client.quotes', 'uses'=>'PublicClientController@quoteDatatable')); Route::get('api/client.invoices', array('as'=>'api.client.invoices', 'uses'=>'PublicClientController@invoiceDatatable')); Route::get('api/client.documents', array('as'=>'api.client.documents', 'uses'=>'PublicClientController@documentDatatable')); @@ -112,7 +112,7 @@ Route::group(['middleware' => 'auth:user'], function() { Route::get('hide_message', 'HomeController@hideMessage'); Route::get('force_inline_pdf', 'UserController@forcePDFJS'); Route::get('account/getSearchData', array('as' => 'getSearchData', 'uses' => 'AccountController@getSearchData')); - + Route::get('settings/user_details', 'AccountController@showUserDetails'); Route::post('settings/user_details', 'AccountController@saveUserDetails'); Route::post('users/change_password', 'UserController@changePassword'); @@ -145,7 +145,7 @@ Route::group(['middleware' => 'auth:user'], function() { Route::get('documents/js/{documents}/{filename}', 'DocumentController@getVFSJS'); Route::get('documents/preview/{documents}/{filename?}', 'DocumentController@getPreview'); Route::post('document', 'DocumentController@postUpload'); - + Route::get('quotes/create/{client_id?}', 'QuoteController@create'); Route::get('quotes/{invoices}/clone', 'InvoiceController@cloneInvoice'); Route::get('quotes/{invoices}/edit', 'InvoiceController@edit'); @@ -600,9 +600,8 @@ if (!defined('CONTACT_EMAIL')) { define('DEFAULT_API_PAGE_SIZE', 15); define('MAX_API_PAGE_SIZE', 100); - define('IOS_PRODUCTION_PUSH', env('IOS_PRODUCTION_PUSH', 'ninjaIOS')); - define('IOS_DEV_PUSH', env('IOS_DEV_PUSH', 'devNinjaIOS')); - + define('IOS_PUSH_CERTIFICATE', env('IOS_PUSH_CERTIFICATE', '')); + define('TOKEN_BILLING_DISABLED', 1); define('TOKEN_BILLING_OPT_IN', 2); define('TOKEN_BILLING_OPT_OUT', 3); @@ -651,7 +650,7 @@ if (!defined('CONTACT_EMAIL')) { define('RESELLER_REVENUE_SHARE', 'A'); define('RESELLER_LIMITED_USERS', 'B'); - + // These must be lowercase define('PLAN_FREE', 'free'); define('PLAN_PRO', 'pro'); @@ -659,7 +658,7 @@ if (!defined('CONTACT_EMAIL')) { define('PLAN_WHITE_LABEL', 'white_label'); define('PLAN_TERM_MONTHLY', 'month'); define('PLAN_TERM_YEARLY', 'year'); - + // Pro define('FEATURE_CUSTOMIZE_INVOICE_DESIGN', 'customize_invoice_design'); define('FEATURE_REMOVE_CREATED_BY', 'remove_created_by'); @@ -674,23 +673,23 @@ if (!defined('CONTACT_EMAIL')) { define('FEATURE_API', 'api'); define('FEATURE_CLIENT_PORTAL_PASSWORD', 'client_portal_password'); define('FEATURE_CUSTOM_URL', 'custom_url'); - + define('FEATURE_MORE_CLIENTS', 'more_clients'); // No trial allowed - + // Whitelabel define('FEATURE_CLIENT_PORTAL_CSS', 'client_portal_css'); define('FEATURE_WHITE_LABEL', 'feature_white_label'); // Enterprise define('FEATURE_DOCUMENTS', 'documents'); - + // No Trial allowed define('FEATURE_USERS', 'users');// Grandfathered for old Pro users define('FEATURE_USER_PERMISSIONS', 'user_permissions'); - + // Pro users who started paying on or before this date will be able to manage users define('PRO_USERS_GRANDFATHER_DEADLINE', '2016-05-15'); - + $creditCards = [ 1 => ['card' => 'images/credit_cards/Test-Visa-Icon.png', 'text' => 'Visa'], 2 => ['card' => 'images/credit_cards/Test-MasterCard-Icon.png', 'text' => 'Master Card'], @@ -746,4 +745,4 @@ if (Utils::isNinjaDev()) //ini_set('memory_limit','1024M'); //Auth::loginUsingId(1); } -*/ \ No newline at end of file +*/ diff --git a/app/Ninja/Notifications/PushFactory.php b/app/Ninja/Notifications/PushFactory.php index 7f882ff1d0a0..723ff824debe 100644 --- a/app/Ninja/Notifications/PushFactory.php +++ b/app/Ninja/Notifications/PushFactory.php @@ -19,13 +19,12 @@ class PushFactory * * Static variables defined in routes.php * - * IOS_PRODUCTION_PUSH - * IOS_DEV_PUSH + * IOS_PUSH_CERTIFICATE */ public function __construct() { - $this->certificate = IOS_DEV_PUSH; + $this->certificate = IOS_PUSH_CERTIFICATE; } /** @@ -93,4 +92,4 @@ class PushFactory return $feedback->getFeedback(); } -} \ No newline at end of file +} diff --git a/app/Services/PushService.php b/app/Services/PushService.php index 17151f93af3f..a96042b92419 100644 --- a/app/Services/PushService.php +++ b/app/Services/PushService.php @@ -41,6 +41,10 @@ class PushService public function sendNotification($invoice, $type) { + if (! IOS_PUSH_CERTIFICATE) { + return; + } + //check user has registered for push notifications if(!$this->checkDeviceExists($invoice->account)) return; @@ -168,4 +172,4 @@ class PushService -} \ No newline at end of file +}