Skip to content

Commit

Permalink
[AMSA-66] Change request links (#151)
Browse files Browse the repository at this point in the history
* [AMSA-66] Change request links

* [AMSA-66] Bump version
  • Loading branch information
maksimroi authored Aug 26, 2024
1 parent 99d7cb5 commit ef49a95
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 18 deletions.
9 changes: 6 additions & 3 deletions chrome-extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
},
{
"matches": [
"https://apps.admob.com/*"
"https://apps.admob.com/*",
"https://admob.google.com/*"
],
"js": [
"sentry.js",
Expand All @@ -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/*"
]
}
}
8 changes: 4 additions & 4 deletions chrome-extension/popup/utils/popupClickHandlers.ts
Original file line number Diff line number Diff line change
@@ -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<chrome.tabs.Tab> {
return new Promise(resolve => {
Expand Down
2 changes: 1 addition & 1 deletion config/development.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
Expand Down
2 changes: 1 addition & 1 deletion config/production.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/core/admob-api/admob-sessions.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export namespace AdMobSessions {
}

function openAdMobSignInWindow (session): Promise<BrowserWindow> {
return openWindow('https://apps.admob.com/v2/home', {
return openWindow('https://admob.google.com/v2/home', {
frame: true,
show: true,
titleBarStyle: 'default',
Expand All @@ -150,7 +150,7 @@ export namespace AdMobSessions {

function getAdmobAccountBySession (session): Promise<ExtractedAdmobAccount> {
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)
Expand Down
16 changes: 11 additions & 5 deletions src/core/admob-api/admob.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Console>) {
Expand Down Expand Up @@ -105,7 +111,7 @@ export class AdmobApiService {

fetchHomePage (): Promise<Response> {
return this.fetcher(
'https://apps.admob.com/v2/home',
'https://admob.google.com/v2/home',
{
'credentials': 'include',
'headers': {
Expand All @@ -123,11 +129,11 @@ export class AdmobApiService {

fetchCamApiAppsSettings (admobAccountId: string): Promise<Response> {
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',
Expand All @@ -138,7 +144,7 @@ export class AdmobApiService {

async getApps(): Promise<string> {
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,
Expand Down

0 comments on commit ef49a95

Please sign in to comment.