小编Edu*_*que的帖子

该横幅未显示来自adMob Ionic 3的ID

当我尝试使用以下代码在设备中运行应用程序时:

ionic cordova build android

它会生成一个APK,并且我已将其安装在设备中。当我使用此代码进行构建时,广告可以正常工作:

showAd() { const bannerConfig: AdMobFreeBannerConfig = { isTesting: true, autoShow: true }; this.admobFree.banner.config(bannerConfig); this.admobFree.banner.prepare() .then(() => { // banner Ad is ready // if we set autoShow to false, then we will need to call the show method here }) .catch(e => console.log(e)); }

当我使用此其他代码进行构建时,广告不会显示:

showAd() { const bannerConfig: AdMobFreeBannerConfig = { id: 'MY-ID-FROM-ADMOB', isTesting: false, autoShow: true }; this.admobFree.banner.config(bannerConfig); this.admobFree.banner.prepare() .then(() => { // banner Ad is ready // if we set autoShow …

admob ionic-framework cordova-plugins ionic3

5
推荐指数
1
解决办法
1934
查看次数

在同一个 goroutine 中使用 Lock 和 Rlock

我正在使用 Go 中的 RWMutex 进行实验,我意识到可以使用以下代码实现这种行为:

  • goroutine 1 - RLock
  • goroutine 1 - 运行解锁
  • goroutine 2 - RLock
  • goroutine 2 - 运行解锁
  • goroutine 2 - 锁
  • goroutine 2 - 解锁
  • goroutine 1 - 锁
  • goroutine 1 - 解锁
package main

import (
    "fmt"
    "sync"
    "time"
)

type RLockAndLockStruct struct {
    mu sync.RWMutex

    mapEx map[string]string
}

func main() {
    r := &RLockAndLockStruct{}
    r.mapEx = make(map[string]string)

    go r.RLockAndLockTest("test", "goroutine 1 - ")
    go r.RLockAndLockTest("test", "goroutine 2 - ")
    time.Sleep(4000 * time.Millisecond)
}

func …
Run Code Online (Sandbox Code Playgroud)

go goroutine

-1
推荐指数
1
解决办法
75
查看次数

标签 统计

admob ×1

cordova-plugins ×1

go ×1

goroutine ×1

ionic-framework ×1

ionic3 ×1