diff --git a/chrome-extension/manifest.json b/chrome-extension/manifest.json index c0d567e..7a29730 100644 --- a/chrome-extension/manifest.json +++ b/chrome-extension/manifest.json @@ -43,7 +43,8 @@ }, { "matches": [ - "https://apps.admob.com/*" + "https://apps.admob.com/*", + "https://admob.google.com/*" ], "js": [ "sentry.js", @@ -67,11 +68,13 @@ ], "host_permissions": [ "*://*.appodeal.com/*", - "*://*.admob.com/*" + "*://*.admob.com/*", + "*://admob.google.com/*" ], "externally_connectable": { "matches": [ - "*://*.admob.com/*" + "*://*.admob.com/*", + "*://admob.google.com/*" ] } } diff --git a/chrome-extension/popup/utils/popupClickHandlers.ts b/chrome-extension/popup/utils/popupClickHandlers.ts index 12c79dc..b22c9bf 100644 --- a/chrome-extension/popup/utils/popupClickHandlers.ts +++ b/chrome-extension/popup/utils/popupClickHandlers.ts @@ -1,10 +1,10 @@ import {Actions, TabJobs} from '../../common/actions'; -const ADMOB_HOME_WITH_RELOGIN = 'https://apps.admob.com/accounts/ClearOSID?continue=https://apps.admob.com/v2'; -const ADMOB_ACCOUNT_ADD_OR_RECONNECT = 'https://app.appodeal.com/apps/linked_networks#AddAdmobAccount'; -const ADMOB_HOME = 'https://apps.admob.com/v2/home'; -const ADMOB_DASHBOARD_ROOT = 'https://apps.admob.com/'; +const ADMOB_HOME_WITH_RELOGIN = 'https://admob.google.com/accounts/ClearOSID?continue=https://admob.google.com/v2'; +const ADMOB_ACCOUNT_ADD_OR_RECONNECT = 'https://app.appodeal.com/integrations/mediation_ad_networks'; +const ADMOB_HOME = 'https://admob.google.com/v2/home?pli=1'; +const ADMOB_DASHBOARD_ROOT = 'https://admob.google.com/v2/home'; async function navigateCurrentTab (url: string): Promise { return new Promise(resolve => { diff --git a/config/development.json.example b/config/development.json.example index efeb1c1..7be518a 100644 --- a/config/development.json.example +++ b/config/development.json.example @@ -3,7 +3,7 @@ "services": { "appodeal": "https://api.appodeal.com/graphql", "appodeal_auth": "https://api.appodeal.com/graphql", - "ad_mob": "https://apps.admob.com" + "ad_mob": "https://admob.google.com/v2" }, "sentry": { "dsn": "" diff --git a/config/production.json.example b/config/production.json.example index f94589a..8bb3cad 100644 --- a/config/production.json.example +++ b/config/production.json.example @@ -3,7 +3,7 @@ "services": { "appodeal": "https://api-services.appodeal.com/admob_plugin/api/v3/graphql", "appodeal_auth": "https://app.appodeal.com/graphql", - "ad_mob": "https://apps.admob.com" + "ad_mob": "https://admob.google.com/v2" }, "sentry": { "dsn": "" diff --git a/package-lock.json b/package-lock.json index 3d66cdd..b02c0e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "admob-sync-app", - "version": "1.0.16", + "version": "1.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2dc6739..9470a7b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "repository": "https://github.com/appodeal/admob-sync-app", "description": "Appodeal AdMob Sync application", "private": true, - "version": "1.0.16", + "version": "1.0.17", "scripts": { "start": "npm run start:app", "start:app": "node --max_old_space_size=4096 node_modules/.bin/webpack --watch --progress --config=webpack/development.ts", diff --git a/src/core/admob-api/admob-sessions.helper.ts b/src/core/admob-api/admob-sessions.helper.ts index 7e18c95..e945814 100644 --- a/src/core/admob-api/admob-sessions.helper.ts +++ b/src/core/admob-api/admob-sessions.helper.ts @@ -129,7 +129,7 @@ export namespace AdMobSessions { } function openAdMobSignInWindow (session): Promise { - return openWindow('https://apps.admob.com/v2/home', { + return openWindow('https://admob.google.com/v2/home', { frame: true, show: true, titleBarStyle: 'default', @@ -150,7 +150,7 @@ export namespace AdMobSessions { function getAdmobAccountBySession (session): Promise { return retry( - () => nodeFetch('https://apps.admob.com/v2/home', {}, session) + () => nodeFetch('https://admob.google.com/v2/home', {}, session) .then(r => r.text()) .then(responseText => extractAccountInfo(responseText)) , 2) diff --git a/src/core/admob-api/admob.api.ts b/src/core/admob-api/admob.api.ts index 85d8f2d..4727331 100644 --- a/src/core/admob-api/admob.api.ts +++ b/src/core/admob-api/admob.api.ts @@ -32,7 +32,13 @@ export class AdmobApiService { } private getPostApiEndpoint (serviceName: string, method: string) { - return [this.host, this.isCamApi(serviceName, method) ? 'cam' : 'inventory', '_/rpc', serviceName, method].join('/'); + return [ + serviceName === 'AppService' ? 'https://apps.admob.com' : this.host, + this.isCamApi(serviceName, method) ? 'cam' : 'inventory', + '_/rpc', + serviceName, + method + ].join('/'); } constructor (private fetcher = fetch, private logger: Partial) { @@ -105,7 +111,7 @@ export class AdmobApiService { fetchHomePage (): Promise { return this.fetcher( - 'https://apps.admob.com/v2/home', + 'https://admob.google.com/v2/home', { 'credentials': 'include', 'headers': { @@ -123,11 +129,11 @@ export class AdmobApiService { fetchCamApiAppsSettings (admobAccountId: string): Promise { return this.fetcher( - `https://apps.admob.com/cam/App?host=ADMOB&pubc=${admobAccountId}`, + `https://admob.google.com/cam/App?authuser=0&host=ADMOB&pubc=${admobAccountId}`, { 'credentials': 'include', 'headers': {'accept': '*/*', 'accept-language': 'en-US'}, - 'referrer': 'https://apps.admob.com/v2/apps/list', + 'referrer': 'https://admob.google.com/v2/apps/list', 'referrerPolicy': 'no-referrer-when-downgrade', 'body': null, 'method': 'POST', @@ -138,7 +144,7 @@ export class AdmobApiService { async getApps(): Promise { return this.fetch( - 'https://apps.admob.com/inventory/_/rpc/InventoryEntityCollectionService/GetApps?authuser=0&authuser=0', + 'https://admob.google.com/v2/inventory/_/rpc/InventoryEntityCollectionService/GetApps?authuser=0&authuser=0', 'application/x-www-form-urlencoded', 'f.req={}', false,