カテゴリー : iOS

[iOS] Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID

iOS アプリにて、Code Sign error が発生してビルドできなかったときの解決方法をメモ。

エラーメッセージ

Code Sign error:
No matching provisioning profile found:
Your build settings specify a provisioning profile with the UUID “XXXXXXXX-2006-4254-8F70-E0316170D737”,
however, no such provisioning profile was found.
Warning: Multiple build commands for output file xxxx
CodeSign error: code signing is required for product type ‘Application’ in SDK ‘iOS 7.0’

解決方法

project.pbxproj の該当する PROVISIONING_PROFILE の行を削除すればビルドが通りました。


参考情報

project.pbxprojの怪 | 株式会社LIG

[iOS] アプリのアップデート申請時の作業メモ

iPhone アプリのアップデート申請時によく迷うので作業メモ。

Have you added or made changes to encryption features since you last uploaded a binary for this product?

→ No

Are you updating this app because of a legal issue?

→ No

AndroidとiPhoneで使えるURLスキーム起動&アプリ未ダウンロードならストアへリダイレクトするJavaScriptサンプルコード

Android と iPhone で使える URL スキーム起動&アプリ未ダウンロードならストアへリダイレクトするJavaScriptサンプルコードをご紹介します。

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>URL scheme / Redirect Test</title>
 
    <script type="text/javascript">
    var userAgent = navigator.userAgent.toLowerCase();
 
    window.onload = function(){
 
      if (userAgent.indexOf("android") > -1) {
        // Launch myapp via URL scheme
        launch_frame.location.href= "myapp://";
 
        setTimeout(function(){
          // Open App DL page in Google Play
          location.href= "http://market.android.com/details?id=com.example.myapp";
        } , 500);
      } else if (userAgent.search(/iphone|ipad|ipod/) > -1) {
        // Launch myapp via URL scheme
        launch_frame.location.href= "myapp://";
 
        setTimeout(function(){
          // Open App DL page in iTunes Store
          location.href= "itmss://itunes.apple.com/us/app/myapp/id123456789?ls=1&mt=8";
        } , 500);
      }
 
    }
    </script>
 
  </head>
 
<body>
  <div style="width:0; height:0; overflow:hidden;">
  <iframe id="launch_frame" name="launch_frame">
  </iframe>
  </div>
</body>
 
</html>

[iOS] Run Script を Release ビルドのときだけ実行する方法

iOS アプリ開発で、Run Script を Release ビルドのときだけ実行する方法をメモ。

下記のように、CONFIGURATION の値が Release のときだけ、if 文の分岐を実行するように書けば OK です。

if [ "${CONFIGURATION}" = "Release" ]; then
  echo Do something really release-like
fi

参考情報

xcode – How can I limit a "Run Script" build phase to my release configuration? – Stack Overflow

[iOS] Google Analytics でキャンペーンのトラッキング

iOS アプリで、Google Analytics でキャンペーンのトラッキングをする方法をメモ。

Campaign Measurement – iOS SDK – Google Analytics — Google Developers

Google Analytics SDK を使ったスマホアプリのトラッキング|コラム アユダンテ株式会社

実装方法は、上記のサイトを見て下さい。

キャンペーンのトラッキングをするためには、アプリだけでは完結せず、初回起動後に一度、Safariのブラウザを開く必要があります。

たまに、初回起動時にそういう変な挙動をしているアプリがあれば、それはどこ経由でダウンロードしたのか?などの情報を取得していると思って下さい。

個人的には、この挙動が嫌なので Google Analytics でキャンペーンのトラッキングはしないことにしました。

[iOS] Google Analytics 2.0 で例外をトラッキングしたいなら trackUncaughtExceptions = YES

iOS アプリ開発で、Google Analytics 2.0 で例外をトラッキングする方法をメモ。

公式ドキュメントには、sendUncaughtExceptions と記載されてるけど、そんなものは無いです。(以前あった?)

Crashes & Exceptions – iOS SDK – Google Analytics — Google Developers

ソースコードを確認すれば分かりますが、Google Analytics で例外のトラッキングを設定する場合は trackUncaughtExceptions = YES を指定しましょう。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GAI sharedInstance].trackUncaughtExceptions = YES; // Enable 
 
  // ... the rest of your code, include other GAI properties you want to set.
}

ドキュメントは、SDKファイルと一緒に含まれてますので、こちらを確認しましょう。

Downloads – iOS SDK – Google Analytics — Google Developers

以上です。

[iOS] デタラメな操作で自動テストしてくれる「CrashMonkey」

iOS アプリで、デタラメな操作で自動テストしてくれる「CrashMonkey」が便利だったのでご紹介します。

GitHub: mokemokechicken/CrashMonkey

続きを読む

[iOS] TSMessages v0.9.3 に現在アクティブなViewを非表示にする dismissActiveNotification メソッドが追加された

iOS アプリ開発で、通知ビューをカンタンに実装できるライブラリ「TSMessages」の version 0.9.3 に、現在表示中のViewを非表示にする dismissActiveNotification メソッドが追加されていました。

toursprung/TSMessages – Changes

/** Fades out the currently displayed notification. If another notification is in the queue,
 the next one will be displayed automatically 
 @return YES if the currently displayed notification could be hidden. NO if no notification 
 was currently displayed.
 */
+ (BOOL)dismissActiveNotification
{
    if ([[TSMessage sharedMessage].messages count] == 0) return NO;
 
    dispatch_async(dispatch_get_main_queue(), ^
    {
        TSMessageView *currentMessage = [[TSMessage sharedMessage].messages objectAtIndex:0];
        if (currentMessage.messageIsFullyDisplayed)
        {
            [[TSMessage sharedMessage] fadeOutNotification:currentMessage];
        }
    });
    return YES;
}

今まで、通知ビューを非表示にするメソッドを外部から呼び出せなかったので、TSMessages を fork して外から呼べるようにして対応していました。

dismissActiveNotification メソッドが追加されたので、これを使うようにします。

[iOS] URL scheme の設定方法

iOS アプリの URLスキームの設定方法をメモ。

URLスキームの設定は下記のサイトを参考にしました。

iOSアプリにとりあえずでもカスタムURLスキームをつけるべし | Technology-Gym

URL Schemes の設定について ios iPhone xcode | Linux & App Labs By pt106

URLスキームでアプリを起動するだけでなく、アプリ起動&指定した動作をさせることもできます。

その際のパスやパラメータの定義は、FacebookアプリのURLスキームの定義が参考になってよさそうです。

IPhone URL Schemes – akosma wiki

以上です。

[iOS] iPhoneアプリのApp StoreダウンロードページのURLを申請前に作成する方法

iPhoneアプリのApp StoreダウンロードページのURLを申請前に作成する方法をメモ。

iPhoneアプリをDLするURLを申請前に作成する方法 – Sawalog

hyperlink – What is "mt=8" in iTunes links for the appstore? – Stack Overflow