下記ファイルをコピーして下さい。
非消耗型とサブスクリプションです。
今回は広告の削除機能です。
目次
ProductManager.swift
import Foundation
import StoreKit
private var productManagers : Set<ProductManager> = Set()
class ProductManager: NSObject, SKProductsRequestDelegate {
private var completionForProductidentifiers : (([SKProduct]?, NSError?) -> Void)?
/////////////////////////////////////////////////////////////////
// 課金アイテム情報を取得 - Get purchase product identifies
/////////////////////////////////////////////////////////////////
class func productsWithProductIdentifiers(productIdentifiers:[String]!, completion:(([SKProduct]?, NSError?) -> Void)?) {
print("InnApp : Product productsWithProductIdentifiers")
let productManager = ProductManager()
productManager.completionForProductidentifiers = completion
let productRequest = SKProductsRequest(productIdentifiers: Set(productIdentifiers))
productRequest.delegate = productManager
productRequest.start()
productManagers.insert(productManager)
}
/////////////////////////////////////////////////////////////////
// SKProductsRequestDelegate Functions
/////////////////////////////////////////////////////////////////
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
print("InnApp : Product productsRequest")
var error : NSError? = nil
if response.products.count == 0 {
print("InnApp : Product productsRequest Getproduct Zero")
error = NSError(domain: "ProductsRequestErrorDomain", code: 0, userInfo: [NSLocalizedDescriptionKey:"プロダクトを取得できませんでした"])
}
completionForProductidentifiers?(response.products, error)
}
func request(_ request: SKRequest, didFailWithError error: Error) {
print("InnApp : Product productsRequest FailWithError")
let error = NSError(domain: "ProductsRequestErrorDomain", code: 0, userInfo: [NSLocalizedDescriptionKey:"プロダクトを取得できませんでした"])
completionForProductidentifiers?(nil, error)
productManagers.remove(self)
}
func requestDidFinish(_ request: SKRequest) {
print("InnApp : Product productsRequest DidFinish")
productManagers.remove(self)
}
/////////////////////////////////////////////////////////////////
// おまけ 価格情報を抽出 - Get purchase product price
/////////////////////////////////////////////////////////////////
class func priceStringFromProduct(product: SKProduct!) -> String {
let numberFormatter = NumberFormatter()
numberFormatter.formatterBehavior = .behavior10_4
numberFormatter.numberStyle = .currency
numberFormatter.locale = product.priceLocale
return numberFormatter.string(from: product.price)!
}
}
PurchaseManager.swift
import Foundation
import StoreKit
private let purchaseManagerSharedManager = PurchaseManager()
@objc protocol PurchaseManagerDelegate: class {
// Purchase Finished Delegate - 課金完了
@objc optional func purchaseManager(purchaseManager: PurchaseManager!, didFinishPurchaseWithTransaction transaction: SKPaymentTransaction!, decisionHandler: ((_ complete : Bool) -> Void)!)
// Suspended Purchase Finished Delegate - 課金完了(中断していたもの)
@objc optional func purchaseManager(purchaseManager: PurchaseManager!, didFinishUntreatedPurchaseWithTransaction transaction: SKPaymentTransaction!, decisionHandler: ((_ complete : Bool) -> Void)!)
// Purchase Failed Delegate - 課金失敗
@objc optional func purchaseManager(purchaseManager: PurchaseManager!, didFailWithError error: NSError!)
// Restore Purchase Finished Delegate リストア完了
@objc optional func purchaseManagerDidFinishRestore(purchaseManager: PurchaseManager!)
// Purchase Deferred Delegate - 承認待ち(ファミリー共有)
@objc optional func purchaseManagerDidDeferred(purchaseManager: PurchaseManager!)
}
class PurchaseManager : NSObject, SKPaymentTransactionObserver{
var delegate : PurchaseManagerDelegate?
private var productIdentifier : String?
private var isRestore : Bool = false
var payment:SKPayment!
// シングルトン
class func sharedManager() -> PurchaseManager {
return purchaseManagerSharedManager;
}
/////////////////////////////////////////////////////////////////
// Purchase Start Func - 課金開始
/////////////////////////////////////////////////////////////////
func startWithProduct(product : SKProduct){
print("InnApp : PurchaseManager startWithProduct")
// Error check and process it - エラーがあれば終了
var errorCount = 0
var errorMessage = ""
if SKPaymentQueue.canMakePayments() == false {
errorCount += 1
errorMessage = "設定で購入が無効になっています。"
}
if self.productIdentifier != nil {
errorCount += 10
errorMessage = "課金処理中です。"
}
if self.isRestore == true {
errorCount += 100
errorMessage = "リストア中です。"
}
if errorCount > 0 {
print("InnApp : PurchaseManager startWithProduct Error", errorCount)
let error = NSError(domain: "PurchaseErrorDomain", code: errorCount, userInfo: [NSLocalizedDescriptionKey:errorMessage])
self.delegate?.purchaseManager!(purchaseManager: self, didFailWithError: error)
return
}
print("InnApp : PurchaseManager startWithProduct CheckSupendedTransactions")
// Use suspended transaction - 未処理のトランザクションがあればそれを利用
let transactions = SKPaymentQueue.default().transactions
if transactions.count > 0 {
for transaction in transactions {
print("InnApp : PurchaseManager startWith", transaction.payment.productIdentifier, transaction.transactionState)
if transaction.transactionState != .purchased {
continue
}
if transaction.payment.productIdentifier == product.productIdentifier {
if let window = UIApplication.shared.delegate?.window {
let ac = UIAlertController(title: nil, message: "\(product.localizedTitle)は購入処理が中断されていました。\nこのまま無料でダウンロードできます。", preferredStyle: .alert)
let action = UIAlertAction(title: "続行", style: UIAlertAction.Style.default, handler: {[weak self] (action : UIAlertAction!) -> Void in
if let weakSelf = self {
weakSelf.productIdentifier = product.productIdentifier
weakSelf.completeTransaction(transaction)
}
})
ac.addAction(action)
window!.rootViewController?.present(ac, animated: true, completion: nil)
return
}
}
}
}
// Make new transaction - 課金処理開始
print("InnApp : PurchaseManager startWithProduct MakeNewTransaction", product.productIdentifier)
let payment = SKMutablePayment(product: product)
SKPaymentQueue.default().add(payment)
self.productIdentifier = product.productIdentifier
}
/////////////////////////////////////////////////////////////////
// Complete Transaction
/////////////////////////////////////////////////////////////////
// func completeTransaction(transaction: SKPaymentTransaction) {
// print("InnApp : PurchaseManager completeTransaction")
//
// SwiftyReceiptValidator.validate(forIdentifier: transaction.payment.productIdentifier, sharedSecret:
//
// //"c00932ed8c6241599bb35fd6077d7adc") { (success, response) in
//
// "9f07e67bfc684c87a7ba8a5878c60799") { (success, response) in
//
// if success {
// if transaction.payment.productIdentifier == self.productIdentifier {
// print("InnApp : PurchaseManager competeTransaction First")
// //課金終了
// self.delegate?.purchaseManager!(purchaseManager: self, didFinishPurchaseWithTransaction: transaction, decisionHandler: { (complete) -> Void in
// if complete == true {
// //トランザクション終了
// SKPaymentQueue.default().finishTransaction(transaction)
// }
// })
// self.productIdentifier = nil
// } else {
// print("InnApp : PurchaseManager completeTransaction Second")
// //課金終了(以前中断された課金処理)
// self.delegate?.purchaseManager!(purchaseManager: self, didFinishUntreatedPurchaseWithTransaction: transaction, decisionHandler: { (complete) -> Void in
// if complete == true {
// //トランザクション終了
// SKPaymentQueue.default().finishTransaction(transaction)
// }
// })
// }
// } else {
// if transaction.payment.productIdentifier == self.productIdentifier {
// self.productIdentifier = nil
// }
// SKPaymentQueue.default().finishTransaction(transaction)
// }
// }
// }
/////////////////////////////////////////////////////////////////
// Complete Transaction2
/////////////////////////////////////////////////////////////////
// MARK: - SKPaymentTransaction process
fileprivate func completeTransaction(_ transaction : SKPaymentTransaction) {
if transaction.payment.productIdentifier == self.productIdentifier {
//課金終了
self.delegate?.purchaseManager!(purchaseManager: self, didFinishPurchaseWithTransaction: transaction, decisionHandler: { (complete) -> Void in
if complete == true {
//トランザクション終了
SKPaymentQueue.default().finishTransaction(transaction)
}
})
self.productIdentifier = nil
}else{
//課金終了(以前中断された課金処理)
self.delegate?.purchaseManager!(purchaseManager: self, didFinishUntreatedPurchaseWithTransaction: transaction, decisionHandler: { (complete) -> Void in
if complete == true {
//トランザクション終了
SKPaymentQueue.default().finishTransaction(transaction)
}
})
}
}
/////////////////////////////////////////////////////////////////
// PurchaseManagerDelegate Functions
/////////////////////////////////////////////////////////////////
func failedTransaction(transaction: SKPaymentTransaction) {
print("InnApp : PurchaseManager failedTransaction")
self.delegate?.purchaseManager!(purchaseManager: self, didFailWithError: NSError.init())
if transaction.payment.productIdentifier == self.productIdentifier {
self.productIdentifier = nil
}
SKPaymentQueue.default().finishTransaction(transaction)
}
// func restoreTransaction(transaction : SKPaymentTransaction) {
// print("InnApp : PurchaseManager restoreTransaction")
// self.delegate?.purchaseManager!(purchaseManager: self, didFinishPurchaseWithTransaction: transaction, decisionHandler: { (complete) -> Void in
// if complete == true {
// SKPaymentQueue.default().finishTransaction(transaction)
// }
// })
// }
func deferredTransaction(transaction : SKPaymentTransaction) {
print("InnApp : PurchaseManager deferredTransaction")
self.delegate?.purchaseManagerDidDeferred!(purchaseManager: self)
if transaction.payment.productIdentifier == self.productIdentifier {
self.productIdentifier = nil
}
}
/////////////////////////////////////////////////////////////////
// SKPaymentTransaction Delegate Functions
/////////////////////////////////////////////////////////////////
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
print("InnApp : PurchaseManager updateTransactions")
//課金状態が更新されるたびに呼ばれる
for transaction in transactions {
print("InnApp : PurchaseManager updatedTransactions", transaction.payment.productIdentifier)
switch transaction.transactionState {
case .purchasing :
print("InnApp : PurchaseManager 課金中")
break
case .purchased :
print("InnApp : PurchaseManager 課金完了")
completeTransaction(transaction)
break
case .failed :
print("InnApp : PurchaseManager 課金失敗")
failedTransaction(transaction: transaction)
break
case .restored :
print("InnApp : PurchaseManager リストア")
restoreTransaction(transaction: transaction)
break
case .deferred :
print("InnApp : PurchaseManager 承認待ち")
deferredTransaction(transaction: transaction)
break
}
}
}
fileprivate func restoreTransaction(transaction : SKPaymentTransaction) {
switch transaction.transactionState {
case .purchasing :
break
case .purchased :
break
case .failed :
break
case .restored :
break
case .deferred :
break
}
delegate?.purchaseManager?(purchaseManager: self, didFinishPurchaseWithTransaction: transaction.original, decisionHandler: { (complete) -> Void in
if complete == true {
SKPaymentQueue.default().finishTransaction(transaction)
}
})
}
// 全ての購入処理が終わったとき
func paymentQueue(_ queue: SKPaymentQueue, removedTransactions transactions: [SKPaymentTransaction]) {
print("InnApp : PurchaseManager removedTransactions")
}
/////////////////////////////////////////////////////////////////
// Restore Purchase Functions & Delegates
/////////////////////////////////////////////////////////////////
// リストア開始
func startRestore() {
print("InnApp : PurchaseManager startRestore")
if self.isRestore == false {
print("InnApp : PurchaseManager startRestore First")
self.isRestore = true
SKPaymentQueue.default().restoreCompletedTransactions()
}else{
print("InnApp : PurchaseManager startRestore Second")
let error = NSError(domain: "PurchaseErrorDomain", code: 0, userInfo: [NSLocalizedDescriptionKey:"リストア処理中です。"])
self.delegate?.purchaseManager!(purchaseManager: self, didFailWithError: error)
}
}
func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) {
print("InnApp : PurchaseManager restoreCompletedTransactionFailed")
//リストア失敗時に呼ばれる
self.delegate?.purchaseManager!(purchaseManager: self, didFailWithError: error as NSError)
self.isRestore = false
}
// 購入履歴が確認できた場合
func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) {
print("InnApp : PurchaseManager PaymentQueueRetoreCompletedTransactions")
//すでに商品を購入していたら、復元を行う
for transaction in queue.transactions {
print("InnApp : PurchaseManager CompleteRestore", transaction.payment.productIdentifier, transaction.transactionState)
UserDefaults.standard.set(true, forKey: transaction.payment.productIdentifier)
if transaction.payment.productIdentifier.range(of: "XXXXX") != nil {
//something to do
}
}
self.isRestore = false
let av = UIAlertView(title: "", message: "Restored Successfully", delegate: nil, cancelButtonTitle: "OK")
av.show()
}
}
SharedInfos.swift
//
// SharedInfos.swift
import Foundation
import GoogleMobileAds
public let adsAppID = "ca-app-pub-3940256099942544~1458002511"
public let bannerID = "ca-app-pub-3940256099942544/2934735716"
public let interstitialID = "ca-app-pub-3940256099942544/4411468910"
public let rewardedID = "ca-app-pub-3940256099942544/1712485313"
public let nativeID = "ca-app-pub-3940256099942544/1712485313"
//obj-cからアクセスするのに必要
@objcMembers
class SharedInfos: NSObject {
static let shared: SharedInfos = SharedInfos()
var productIdentifiers : [String] = ["XXXXX","XXXXXX2"]
var localStoreUpdate: Bool // localstore update flag
override init() {
localStoreUpdate = false
}
// check AdsRewarded time and return hide/show Ads
func getIntervalTimeAds() -> Bool {
let defaults = UserDefaults.standard
let rewardIntervalDate = defaults.object(forKey: "rewardInterval") as! Date!
if rewardIntervalDate == nil {
return true
}
let retInterval:Double! = rewardIntervalDate?.timeIntervalSinceNow
let ret = retInterval/60
if ret > -60 {
return false
} else {
return true
}
}
}
AppDelegate.swift
AppDelegate.swiftでも準備をします。
抜粋なので注意
//
// AppDelegate.swift
import UIKit
import StoreKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,PurchaseManagerDelegate{
var window: UIWindow?
var shouldRotate = true
var defaults = UserDefaults.standard
var productIdentifiers : [String] = [SharedInfos.shared.productIdentifiers[0],SharedInfos.shared.productIdentifiers[1]]
var productInfo2:String = ""
var productInfoAll:String = ""
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd, didRewardUserWith reward: GADAdReward) {
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//Load//purchase viewで表示するために使用
fetchProductInformationForIds(productIds: productIdentifiers)
// アプリ内課金設定
//---------------------------------------
// デリゲート設定
PurchaseManager.sharedManager().delegate = self
// Attach an observer to the payment queue.
SKPaymentQueue.default().add(PurchaseManager.sharedManager())
GADMobileAds.configure(withApplicationID: adsAppID)
FirebaseApp.configure()
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
GADRewardBasedVideoAd.sharedInstance().delegate = self
let request = GADRequest()
request.testDevices = [kGADSimulatorID] as! [String]
GADRewardBasedVideoAd.sharedInstance().load(request, withAdUnitID:rewardedID)
// self.window?.makeKeyAndVisible()
return true
}
// Called when the application is about to terminate.
func applicationWillTerminate(_ application: UIApplication) {
// Remove the observer.
SKPaymentQueue.default().remove(PurchaseManager.sharedManager())
}
private func fetchProductInformationForIds(productIds:[String]) {
ProductManager.productsWithProductIdentifiers(productIdentifiers: productIds, completion: {(products : [SKProduct]!, error : NSError?) -> Void in
if error != nil {
print("AppDelegate : Fetch Info failed \(error!.localizedDescription)")
return
}
var emptyCount = 0;
for product in products {
let priceString = ProductManager.priceStringFromProduct(product: product)
print("AppDelegate : ProductInfo " + product.localizedTitle + ":\(priceString)")
//monthly
if(emptyCount == 0){
//self.productInfo2 = product.localizedTitle + ":\(priceString)"
self.productInfoAll = product.localizedTitle + ":\(priceString)"
print("AppDelegate == 0",self.productInfoAll)
}
//non
if(emptyCount == 1){
//self.productInfo2 = product.localizedTitle + ":\(priceString)"
self.productInfo2 = product.localizedTitle + ":\(priceString)"
print("AppDelegate == 1",product.localizedTitle + ":\(priceString)");
}
emptyCount += 1;
// self.productInfo2 = product.localizedTitle + ":\(priceString)"
// self.productInfo3 = product.localizedTitle + ":\(priceString)"
// self.productInfo4 = product.localizedTitle + ":\(priceString)"
// self.productInfo5 = product.localizedTitle + ":\(priceString)"
// self.productInfoAll = product.localizedTitle + ":\(priceString)"
}
}
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return shouldRotate ? .all : .portrait
}
}
PurchaseViewController.swift
課金ページにはPurchaseViewController.swiftとPurchaseViewController.xibを用意した。
ExpandingMenunに関してはこちらを参照
https://github.com/monoqlo/ExpandingMenu
//
// PurchaseViewController.swift
import UIKit
import Foundation
import UIKit
import GoogleMobileAds
import StoreKit
import MessageUI
import AVFoundation
import StoreKit
import ExpandingMenu
import Firebase
class PurchaseViewController: UIViewController, GADRewardBasedVideoAdDelegate, MFMailComposeViewControllerDelegate, PurchaseManagerDelegate,GADInterstitialDelegate{
let userDefaults: UserDefaults = UserDefaults.standard
let defaults = UserDefaults.standard
var passedString: String?
var productIdentifiers : [String] = [SharedInfos.shared.productIdentifiers[0],SharedInfos.shared.productIdentifiers[1]]
@IBOutlet weak var termsTextView: UITextView!
@IBOutlet weak var backBtn: UIButton!
var interstitial: GADInterstitial? // interstitial Ads
@IBOutlet var bannerView: GADBannerView!
@IBOutlet weak var bannerBorder: NSLayoutConstraint!
var productInfo2:String = ""
var productInfoAll:String = ""
///////////////////////////////////////////////////
// Mark - RewaredAds Functions
///////////////////////////////////////////////////
func onclickWatchAdsBtn() {
let localStr = NSLocalizedString("3minutes", comment: "")
utilityAlert2(string: localStr)
// click "WatchAds" button to show rewarded Ads
GADRewardBasedVideoAd.sharedInstance().delegate = self
let request = GADRequest()
request.testDevices = [kGADSimulatorID] as! [String]
GADRewardBasedVideoAd.sharedInstance().load(request, withAdUnitID:rewardedID)
}
///////////////////////////////////////////////////
// Back Section
///////////////////////////////////////////////////
@IBAction func onclickBack(_ sender: Any) {
//let vc = UIStoryboard(name: "FirstViewController", bundle: nil).instantiateInitialViewController()!
//navigationController?.pushViewController(vc, animated: true)
self.dismiss(animated: true, completion: nil)
}
///////////////////////////////////////////////////
// Term Section
///////////////////////////////////////////////////
func onclickTerm() {
//purchase(productId:productIdentifiers[0])
let url: NSURL = NSURL(string: "XXXXXX")!
UIApplication.shared.openURL(url as URL)
}
override func viewDidLoad() {
super.viewDidLoad()
let userDefaults: UserDefaults = UserDefaults.standard
var translateCountTraditional: Int = userDefaults.integer(forKey: "admobCount")
translateCountTraditional += 1
print("admobCount = %d", translateCountTraditional)
userDefaults.set(translateCountTraditional, forKey: "admobCount")
userDefaults.synchronize()
if translateCountTraditional % 5 == 0 {
loadAdMobIntersBanner()
//callNativeView()
}
let localStr1 = NSLocalizedString("back", comment: "")
self.backBtn.setTitle(localStr1, for: .normal)
//Menu
configureExpandingMenuButton()
//ads
viewWillAds()
// Do any additional setup after loading the view.
//Load
fetchProductInformationForIds(productIds: productIdentifiers)
// fetchProductInformationForIds(productIds: [productIdentifiers[10]])
let localStr = NSLocalizedString("purchaseString", comment: "")
termsTextView.text = localStr;
// リンク、日付などを自動的に検出してリンクに変換する.
termsTextView.dataDetectorTypes = UIDataDetectorTypes.all
// テキストを編集不可にする.
termsTextView.isEditable = false
}
override func viewWillAppear(_ animated: Bool) {
print("InnApp : ViewWillAppear")
super.viewWillAppear(animated)
//ads
viewWillAds()
}
// Alert functions for rewardedAds
func utilityAlert(string:String) {
let alert = UIAlertController(title: "", message: "\(string)", preferredStyle: UIAlertController.Style.alert)
self.present(alert, animated: true, completion: nil)
let localStr = NSLocalizedString("alertOKBtn", comment: "")
alert.addAction(UIAlertAction(title: localStr, style: .default, handler: { action in
switch action.style{
case .default:
print("SettingView : utilityAlert default")
case .cancel:
print("SettingView : utilityAlert cancel")
case .destructive:
print("SettingView : utilityAlert destructive")
}
}))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
fileprivate func configureExpandingMenuButton() {
let myBoundSize: CGSize = UIScreen.main.bounds.size
let menuButtonSize: CGSize = CGSize(width: 64.0, height: 64.0)
let menuButton = ExpandingMenuButton(frame: CGRect(origin: CGPoint.zero, size: menuButtonSize), image: UIImage(named: "chooser-button-tab")!, rotatedImage: UIImage(named: "chooser-button-tab-highlighted")!)
if UIDevice.current.userInterfaceIdiom == .phone {
// 使用デバイスがiPhoneの場合
menuButton.center = CGPoint(x:SharedInfos.shared.MSScreenW-50, y:SharedInfos.shared.MSScreenH-100)
} else if UIDevice.current.userInterfaceIdiom == .pad {
// 使用デバイスがiPadの場合
menuButton.center = CGPoint(x:SharedInfos.shared.MSScreenW-100, y:SharedInfos.shared.MSScreenH-100)
}
//menuButton.center = CGPoint(x:myBoundSize.width/3, y:myBoundSize.height/3)
//menuButton.center = CGPoint(x: self.view.bounds.width - 32.0, y: self.view.bounds.height - 65)
//menuButton.center = CGPoint(x: self.view.bounds.width - 32.0, y: self.view.bounds.height-12)
//menuButton.center = CGPoint(x: self.view.bounds.width - 32.0, y: self.view.bounds.height - 72.0)
view.addSubview(menuButton)
menuButton.layer.zPosition = 10;
self.view.addSubview(menuButton)
self.view.addSubview(menuButton)
func aaaa(){
}
let localStr13 = NSLocalizedString("restore", comment: "")
let localStr14 = NSLocalizedString("watchads", comment: "")
let localStr15 = NSLocalizedString("onclickTerm", comment: "")
let item4 = ExpandingMenuItem(size: menuButtonSize, title: "", image: UIImage(named: "no")!, highlightedImage: UIImage(named: "no")!, backgroundImage: UIImage(named: "no"), backgroundHighlightedImage: UIImage(named: "no")) { () -> Void in
//print("nullにしてみた");
}
//AppDelegateから値を受け取る
let appDelegate:AppDelegate = UIApplication.shared.delegate as! AppDelegate
let non = appDelegate.productInfo2
let auto = appDelegate.productInfoAll
print("auto--",auto)
print("non--",non)
//localStr11
let item12 = ExpandingMenuItem(size: menuButtonSize, title:non, image: UIImage(named: "chooser-moment-icon-sleep")!, highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
print("purchase remove ads");
self.startPurchase(productId:self.productIdentifiers[0])
}
//localStr12
let item13 = ExpandingMenuItem(size: menuButtonSize, title:auto, image: UIImage(named: "chooser-moment-icon-sleep")!, highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
print("purchase remove ads auto");
self.startPurchase(productId:self.productIdentifiers[1])
}
let item14 = ExpandingMenuItem(size: menuButtonSize, title: localStr13, image: UIImage(named: "chooser-moment-icon-sleep")!, highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
print("restore");
self.startRestore();
}
let item15 = ExpandingMenuItem(size: menuButtonSize, title: localStr14, image: UIImage(named: "chooser-moment-icon-sleep")!, highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
print("reward");
self.onclickWatchAdsBtn();
}
let item16 = ExpandingMenuItem(size: menuButtonSize, title: localStr15, image: UIImage(named: "chooser-moment-icon-sleep")!, highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
self.onclickTerm()
print("利用規約");
}
// item1.layer.zPosition = 10;
// item2.layer.zPosition = 10;
menuButton.addMenuItems([item12,item13,item14,item15,item16])
menuButton.willPresentMenuItems = { (menu) -> Void in
print("MenuItems will present.")
}
menuButton.didDismissMenuItems = { (menu) -> Void in
print("MenuItems dismissed.")
}
}
func utilityAlert2(string:String) {
let alert = UIAlertController(title: "\(string)", message: "", preferredStyle: UIAlertController.Style.alert)
//alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.Default, handler: nil))
self.present(alert, animated: true, completion: nil)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
switch action.style{
case .default:
print("ok")
GADRewardBasedVideoAd.sharedInstance().delegate = self
let request = GADRequest()
request.testDevices = [kGADSimulatorID] as! [String]
GADRewardBasedVideoAd.sharedInstance().load(request, withAdUnitID:rewardedID)
print("onclickWatchAdsBtn");
Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
AnalyticsParameterItemID: "id-reward",
AnalyticsParameterItemName: "reward",
AnalyticsParameterContentType: "cont"
])
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}
}))
}
func viewWillAds(){
// Check Banner Ads available and show/hide BannerAds
let admobBoolResult = defaults.bool(forKey:productIdentifiers[0])
defaults.synchronize()
var packageAuto = 0
let autoBool = defaults.bool(forKey:productIdentifiers[1])
defaults.synchronize()
if autoBool {
packageAuto = 1
}
if (admobBoolResult||packageAuto >= 1) {
self.hideBannerView()
//self.watchAdsBtn.isHidden = true
} else {
let isLoadRewardAds: Bool = SharedInfos.shared.getIntervalTimeAds()
if isLoadRewardAds == false {
self.hideBannerView()
//self.watchAdsBtn.isHidden = true
} else {
self.showBannerView()
//self.watchAdsBtn.isHidden = false
self.bannerView.adUnitID = bannerID
bannerView.rootViewController = self
let request = GADRequest()
request.testDevices = [ kGADSimulatorID ] as! [String]; // All simulators
bannerView.load(request)
// self.bannerView.adUnitID = bannerID
// bannerView.rootViewController = self
// let request = GADRequest()
// request.testDevices = [ kGADSimulatorID ]; // All simulators
// bannerView.load(request)
}
}
}
func loadAdMobReward(){
let isLoadRewardAds: Bool = SharedInfos.shared.getIntervalTimeAds()
if isLoadRewardAds == true {
if GADRewardBasedVideoAd.sharedInstance().isReady {
GADRewardBasedVideoAd.sharedInstance().present(fromRootViewController: self)
} else {
let localStr = NSLocalizedString("adsAlert1", comment: "")
utilityAlert(string: localStr)
}
}
}
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd, didFailToLoadWithError error: Error) {
print("SettingView : didFailToLoadWithError :", error.localizedDescription)
let localStr = NSLocalizedString("adsAlert2", comment: "")
utilityAlert(string: localStr)
}
func rewardBasedVideoAdDidReceive(_ rewardBasedVideoAd: GADRewardBasedVideoAd) {
print("SettingView : rewardBasedVideoAdDidReceive")
loadAdMobReward()
}
func rewardBasedVideoAdDidOpen(_ rewardBasedVideoAd: GADRewardBasedVideoAd) {
print("SettingView : rewardBasedVideoAdDidOpen")
}
func rewardBasedVideoAdDidStartPlaying(_ rewardBasedVideoAd: GADRewardBasedVideoAd) {
print("SettingView : rewardBasedVideoAdDidStartPlaying")
}
func rewardBasedVideoAdDidClose(_ rewardBasedVideoAd: GADRewardBasedVideoAd) {
print("SettingView : rewardBasedVideoAdDidClose")
}
func rewardBasedVideoAdWillLeaveApplication(_ rewardBasedVideoAd: GADRewardBasedVideoAd) {
print("SettingView : rewardBasedVideoAdWillLeaveApplication")
}
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd, didRewardUserWith reward: GADAdReward) {
print("SettingView : Reward received with currency: \(reward.type), amount \(reward.amount).")
//リワード視聴完了時に呼ばれる
earnCoins(NSInteger(truncating: reward.amount))
Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
AnalyticsParameterItemID: "id-reward-fin",
AnalyticsParameterItemName: "reward-fin",
AnalyticsParameterContentType: "cont"
])
}
// Set rewarded time
fileprivate func earnCoins(_ coins: NSInteger) {
userDefaults.set(Date(), forKey: "rewardInterval")
userDefaults.synchronize()
print("SettingView : Set new rewarded time")
//とにかく消す
//self.hideBannerView()
//とにかく出現
let delayTime = DispatchTime.now() + .seconds(1)
DispatchQueue.main.asyncAfter(deadline: delayTime) {
//taskText表示
// self.delayPurchase()
}
}
// Hide/Show bannerAds functions
func hideBannerView() {
if self.bannerView.isHidden == true {
return
}
self.bannerView.isHidden = true
//self.bannerBorder.constant = self.bannerBorder.constant - self.bannerView.frame.height
//self.watchAdsBtn.isHidden = true
}
func showBannerView() {
if self.bannerView.isHidden == false {
return
}
self.bannerView.isHidden = false
// self.bannerBorder.constant = 0
//self.watchAdsBtn.isHidden = false
}
// Load interstitial Ads function
///////////////////////////////////////////////////
// Mark - Interstital Ads load function
///////////////////////////////////////////////////
func loadAdMobIntersBanner() {
// Check InterstitialAds available and Show
let admobBoolResult = defaults.bool(forKey:productIdentifiers[0])
defaults.synchronize()
var packageAuto = 0
let autoBool = defaults.bool(forKey:productIdentifiers[1])
defaults.synchronize()
if autoBool {
packageAuto = 1
}
if (admobBoolResult||packageAuto >= 1) {
return
} else {
let isLoadRewardAds: Bool = SharedInfos.shared.getIntervalTimeAds()
if isLoadRewardAds == false {
return
} else {
interstitial = GADInterstitial(adUnitID: interstitialID)
interstitial!.delegate = self
let request = GADRequest()
request.testDevices = [ kGADSimulatorID ] as! [String]; // All simulators
interstitial?.load(request)
}
}
}
func getIntervalDays(date:Date?, anotherDay:Date? = nil) -> Double {
var retInterval:Double!
if anotherDay == nil {
retInterval = date?.timeIntervalSinceNow
} else {
retInterval = date?.timeIntervalSince(anotherDay!)
}
let ret = retInterval/86400
return floor(ret) // n日
}
///////////////////////////////////////////////////
// Mark - // Get purchase product identifies - プロダクト情報取得
///////////////////////////////////////////////////
private func fetchProductInformationForIds(productIds:[String]) {
ProductManager.productsWithProductIdentifiers(productIdentifiers: productIds, completion: {(products : [SKProduct]!, error : NSError?) -> Void in
if error != nil {
print("SettingView : Fetch Info failed \(error!.localizedDescription)")
return
}
var emptyCount = 0;
for product in products {
let priceString = ProductManager.priceStringFromProduct(product: product)
print("SettingView : ProductInfo " + product.localizedTitle + ":\(priceString)")
//monthly
if(emptyCount == 0){
//self.productInfo2 = product.localizedTitle + ":\(priceString)"
self.productInfoAll = product.localizedTitle + ":\(priceString)"
print("emptyCount == 0",self.productInfoAll)
}
//non
if(emptyCount == 1){
//self.productInfo2 = product.localizedTitle + ":\(priceString)"
self.productInfo2 = product.localizedTitle + ":\(priceString)"
print("emptyCount == 1",product.localizedTitle + ":\(priceString)");
}
emptyCount += 1;
// self.productInfo2 = product.localizedTitle + ":\(priceString)"
// self.productInfo3 = product.localizedTitle + ":\(priceString)"
// self.productInfo4 = product.localizedTitle + ":\(priceString)"
// self.productInfo5 = product.localizedTitle + ":\(priceString)"
// self.productInfoAll = product.localizedTitle + ":\(priceString)"
}
})
}
///////////////////////////////////////////////////
// リストア開始
///////////////////////////////////////////////////
func startRestore() {
print("InnApp : startRestore")
Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
AnalyticsParameterItemID: "id-startRestore",
AnalyticsParameterItemName: "startRestore",
AnalyticsParameterContentType: "cont"
])
PurchaseManager.sharedManager().delegate = self
PurchaseManager.sharedManager().startRestore()
}
///////////////////////////////////////////////////
// In-App Purchase First Func - 課金開始
///////////////////////////////////////////////////
private func startPurchase(productId:String) {
print("InnApp : Purchase Start - ", productId)
PurchaseManager.sharedManager().delegate = self
// Check product exist
ProductManager.productsWithProductIdentifiers(productIdentifiers: [productId], completion: {[weak self] (products : [SKProduct]!, error : NSError?) -> Void in
if error != nil {
if let weakSelf = self {
let localStr = NSLocalizedString("InnAppMsg1", comment: "")
weakSelf.utilityAlert(string: localStr)
}
return
}
if products.count > 0 {
//課金処理開始
print("InnApp : Call startWithProduct", products[0].productIdentifier)
PurchaseManager.sharedManager().startWithProduct(product: products[0])
} else {
if let weakSelf = self {
let localStr = NSLocalizedString("InnAppMsg2", comment: "")
weakSelf.utilityAlert(string: localStr)
}
}
})
}
///////////////////////////////////////////////////
// PurchaseManagerDelegate Functions
///////////////////////////////////////////////////
func purchaseManager(purchaseManager: PurchaseManager!, didFinishPurchaseWithTransaction transaction: SKPaymentTransaction!, decisionHandler: ((_ complete: Bool) -> Void)!) {
print("InnApp : FinishPruchaseWithTransaction", transaction.payment.productIdentifier)
Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
AnalyticsParameterItemID: "id-\(transaction.payment.productIdentifier))",
AnalyticsParameterItemName: "\(transaction.payment.productIdentifier)",
AnalyticsParameterContentType: "cont"
])
//課金終了時に呼び出される
userDefaults.set(true, forKey: transaction.payment.productIdentifier)
userDefaults.synchronize()
if transaction.payment.productIdentifier.range(of: "addLanguage.") != nil {
//Languages.share.seperateLanguages()
//Languages.share.generateSubLanguage()
}
//コンテンツ解放が終了したら、この処理を実行(true: 課金処理全部完了, false 課金処理中断)
decisionHandler(true)
}
func purchaseManager(purchaseManager: PurchaseManager!, didFinishUntreatedPurchaseWithTransaction transaction: SKPaymentTransaction!, decisionHandler: ((_ complete: Bool) -> Void)!) {
print("InnApp : FinishUntreatedPruchaseWithTransaction", transaction.payment.productIdentifier)
//課金終了時に呼び出される
userDefaults.set(true, forKey: transaction.payment.productIdentifier)
userDefaults.synchronize()
if transaction.payment.productIdentifier.range(of: "addLanguage.") != nil {
// Languages.share.seperateLanguages()
// Languages.share.generateSubLanguage()
}
//コンテンツ解放が終了したら、この処理を実行(true: 課金処理全部完了, false 課金処理中断)
decisionHandler(true)
}
func purchaseManager(purchaseManager: PurchaseManager!, didFailWithError error: NSError!) {
print("InnApp : PurchaseDidFailWithError")
//課金失敗時に呼び出される
let localStr = NSLocalizedString("InnAppMsg4", comment: "")
self.utilityAlert(string: localStr)
}
func purchaseManagerDidFinishRestore(purchaseManager: PurchaseManager!) {
print("InnApp : FinishPurchaseRestore")
//リストア終了時に呼び出される(個々のトランザクションは”課金終了”で処理)
let localStr = NSLocalizedString("InnAppMsg5", comment: "")
self.utilityAlert(string: localStr)
}
func purchaseManagerDidDeferred(purchaseManager: PurchaseManager!) {
print("InnApp : Purchase DidDeferred")
//承認待ち状態時に呼び出される(ファミリー共有)
let localStr = NSLocalizedString("InnAppMsg6", comment: "")
self.utilityAlert(string: localStr)
}
}
PurchaseViewController.xib
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <customFonts key="customFonts"> <array key="Kaiso-Makina-B.otf"> <string>Kaiso-Makina-B</string> </array> </customFonts> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PurchaseViewController" customModule="Korean_Translation" customModuleProvider="target"> <connections> <outlet property="backBtn" destination="CS1-oY-wVt" id="Elr-Ls-5Se"/> <outlet property="bannerView" destination="NcJ-dM-Kee" id="lHs-MD-66Q"/> <outlet property="termsTextView" destination="ONr-Rs-Xk0" id="me2-Ci-omM"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> </connections> </placeholder> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NcJ-dM-Kee" customClass="GADBannerView"> <rect key="frame" x="16" y="64" width="343" height="50"/> <color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="height" constant="50" id="iBy-jo-3Xy"/> </constraints> </view> <navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bLs-t7-KYa"> <rect key="frame" x="16" y="20" width="343" height="44"/> <constraints> <constraint firstAttribute="height" constant="44" id="rsM-Aa-zvH"/> </constraints> <items> <navigationItem id="8mH-FU-gRa"> <barButtonItem key="leftBarButtonItem" style="plain" id="4lJ-6I-oBx"> <button key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="CS1-oY-wVt"> <rect key="frame" x="16" y="6" width="39" height="32"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/> <state key="normal" title="Back"/> <connections> <action selector="onclickBack:" destination="-1" eventType="touchUpInside" id="Uj9-JR-eM8"/> </connections> </button> </barButtonItem> </navigationItem> </items> </navigationBar> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" text="null" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="ONr-Rs-Xk0"> <rect key="frame" x="16" y="114" width="343" height="553"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <rect key="contentStretch" x="1" y="0.0" width="1" height="1"/> <fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/> <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> <connections> <outlet property="delegate" destination="-1" id="H7D-k7-4G8"/> </connections> </textView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="NcJ-dM-Kee" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="16" id="6ZQ-na-afD"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ONr-Rs-Xk0" secondAttribute="trailing" constant="16" id="7ua-20-ljF"/> <constraint firstItem="NcJ-dM-Kee" firstAttribute="top" secondItem="bLs-t7-KYa" secondAttribute="bottom" id="K5w-1Z-XIt"/> <constraint firstItem="ONr-Rs-Xk0" firstAttribute="top" secondItem="NcJ-dM-Kee" secondAttribute="bottom" id="RGu-rp-3pO"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="bLs-t7-KYa" secondAttribute="trailing" constant="16" id="cf2-RW-Vbw"/> <constraint firstItem="ONr-Rs-Xk0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="16" id="ihi-l3-QZb"/> <constraint firstItem="bLs-t7-KYa" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="16" id="ioa-XL-e8N"/> <constraint firstItem="bLs-t7-KYa" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="jQU-Py-XTC"/> <constraint firstItem="ONr-Rs-Xk0" firstAttribute="bottom" secondItem="fnl-2z-Ty3" secondAttribute="bottom" id="mhb-eX-mYn"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="NcJ-dM-Kee" secondAttribute="trailing" constant="16" id="wuS-EO-2Dc"/> </constraints> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <point key="canvasLocation" x="-8.8000000000000007" y="119.1904047976012"/> </view> </objects> </document>
おまけにLocalizable.stringsも追加。
"languageBtn1" = "選択"; "languageBtn2" = "言語を変更する"; "loadingHUD" = "ロード中......(^^)"; "errorHUD" = "インターネットの接続が失敗しました!!!"; "successHUD" = "成功!"; "updateTitle" = "アップデートがあります(^^)"; "updateBtn1" = "AppStore"; "updateBtn2" = "キャンセル"; "adsAlert1" = "申し訳ありません. ロードが失敗しました"; "adsAlert2" = "申し訳ありません. 接続が失敗しました"; "alertOKBtn" = "確認"; "storeUpdate" = "データベース更新中"; "storeError" = "更新失敗!"; "storeFinish" = "アップデート成功!"; "InnAppMsg1" = "商品情報の取得に失敗"; "InnAppMsg2" = "商品がありません!"; "InnAppMsg3" = "課金完了(中断していたもの)"; "InnAppMsg4" = "課金失敗"; "InnAppMsg5" = "リストア完了"; "InnAppMsg6" = "課金 承認待ち"; "InnAppMsg7" = "メールは送信できません"; "NoVoice" = "音声をサポートしていません"; "feedback" = "フィードバック"; "purchase" = "全ての機能を追加"; "purchaseM" = "全ての機能を追加/月額"; "restore" = "購入復元"; "purchaseString" = "---月額購入に関して---\n--タイトル--\n広告の削除\n• 月額購入期間(各月額購入期間中に提供される期間およびコンテンツまたはサービス)\ n月額購入期間(1ヶ月)\n================\n広告の削除をすることができます!\n================\n• 月額購入価格、および必要に応じて単価\n0.99ドル\n• 購入の確認時にiTunesアカウントにて支払いが行われます\n• 現在の期間が終了する前に少なくとも24時間、自動更新がオフになっていない限り、登録は自動的に更新されます\n• アカウントには、現在の期間が終了する前の24時間以内に更新が請求され、更新の費用が識別されます\n• 購読はユーザーによって管理され、購入後にユーザーのアカウント設定に移動すると自動更新がオフになることがあります\n• 無料試用期間の未使用部分は、提供されている場合は、ユーザーが該当する場合はその書籍の購読を購入すると失効します\n– 利用規約へのリンク\nhttps://bigtranslatorprivacy.blogspot.com/2018/11/terms-conditions.html\n–プライバシーポリシーリンク\nhttps://bigtranslatorprivacy.blogspot.com/2018/11/privacy-policy.html"; "purchaseString1" = "購入"; "purchaseString2" = "購入をして下さい"; "purchaseString3" = "購入"; "purchaseString4" = "購入/月額"; "purchaseString5" = ""; "mailString" = "iPhoneの設定でメールアカウントを接続するか、直接私に連絡するにはt_iphone_app@yahoo.co.jpを使用してください。"; "Thanks!" = "ありがとう!"; "selectLanguage" = "言語とテキストを選択して入力してください"; "googleResult" = "谷歌翻译结果 "; "bingResult" = "必应翻译结果 "; "yandexResult" = "Yandex翻译结果 "; "weblioResult" = "Weblio翻译结果 "; "exciteResult" = "Excite翻译结果 "; "youdaoResult" = "有道翻译结果 "; "share" = "シェア"; "removeads" = "広告の削除"; "translate" = "翻訳"; "voice" = "音声"; "copy" = "コピー"; "save" = "セーブ"; "delete" = "削除"; "reward" = "動画広告🎥"; "purchase" = "プライバシーポリシー"; "done" = "終了"; "back" = "戻る"; "info" = "プライバシーポリシー"; "selectT" = "繁体字优先"; "selectS" = "简体的字优先"; "privacyString1" = "プライバシーポリシー"; "privacyString2" = "同意"; "privacyString3" = "同意しない"; "privacyString4" = "プライバシーポリシーでは、アプリケーションによって収集されたデータとその取り扱いと使用目的が示されます。同意しない場合、このアプリを使用することはできません。プライバシーポリシーボタンをクリックして、プライバシーポリシーをお読みください"; "watchads" = "動画広告🎥"; "onclickTerm" = "利用規約"; "3minutes" = "広告のを視聴後に60分間アンロックされます"; //////追加 "ocr" = "OCR"; "history" = "履歴"; "translation" = "翻訳"; "dictionary" = "辞書"; "result1" = "日本語 Or ビルマ語の結果"; "result1a" = "英語 Or ビルマ語の結果"; "result1b" = "中国語(繁) Or ビルマ語の結果"; "result1c" = "中国語(簡) Or ビルマ語の結果"; "result2" = "英語の結果"; "segmentString1" = "日本語→ビルマ語"; "segmentString2" = "ビルマ語→日本語"; "segmentString3" = "英語→ビルマ語"; "segmentString4" = "ビルマ語→英語"; "segmentString5" = "中国語(繁)→ビルマ語"; "segmentString6" = "ビルマ語→中国語(繁)"; "segmentString7" = "中国語(簡)→ビルマ語"; "segmentString8" = "ビルマ語→中国語(簡)"; "hereText" = "テキストを入力して言語を選択して翻訳ボタンを押した下さい ";//请输入内容 "hereText2" = "言語選択";//请选择选项 "masaru" = "まさる"; "voiceJapanese" = "日本語音声"; "voiceBurmese" = "ビルマ語音声"; "voiceEnglish" = "英語音声"; "voiceCht" = "中国語(繁)音声"; "voiceChs" = "中国語(簡)音声"; "selectVoice" = "音声選択"; "learnLanguage0" = "日本語とビルマ語を学習できます🤤画像を押してください"; "learnLanguage1" = "英語とビルマ語を学習できます🤤画像を押してください"; "learnLanguage2" = "中国語(繁)とビルマ語を学習できます🤤画像を押してください"; "learnLanguage3" = "中国語(簡)とビルマ語を学習できます🤤画像を押してください"; "learnLanguage4" = "ビルマ語の言語コードを取得できます🤤画像を押してください"; "currentLanguage0" = "現在の言語: 日本語ビルマ語"; "currentLanguage1" = "現在の言語: 英語ビルマ語"; "currentLanguage2" = "現在の言語: 中国語(繁)ビルマ語"; "currentLanguage3" = "現在の言語: 中国語(簡)ビルマ語"; "mapalert9" = "購入をすればアンロックができます"; "trip" = "旅行"; "firstMeeting" = "初対面"; "conversation" = "会話"; "work" = "仕事"; "date" = "デート"; "greeting" = "挨拶"; "others" = "その他"; "goAPP" = "アプリへ";//立即进入 "startOCRText" = "スタート"; "startText" = "認識テキスト:"; "startText2" = "これをやろう!"; "ADD" = "Menu"; "menuBtn" = "MENU"; "start" = "MENU";