{"id":4093,"date":"2016-08-08T17:21:17","date_gmt":"2016-08-08T09:21:17","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4093"},"modified":"2016-08-09T21:23:59","modified_gmt":"2016-08-09T13:23:59","slug":"qsdk-%e5%9c%a8-ios-%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%be%ae%e4%bf%a1-sdk-%e7%9a%84%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4093","title":{"rendered":"[QSDK] \u5728 iOS \u4e2d\u4f7f\u7528\u5fae\u4fe1 SDK \u7684\u6b65\u9aa4"},"content":{"rendered":"<p>\u5728 Android \u4e2d\u96c6\u6210\u5fae\u4fe1 SDK \u7684\u6b65\u9aa4\u53c2\u8003\uff1a<a href=\"https:\/\/blog.qdac.cc\/?p=4112\">[QSDK] \u5728 Android \u4f7f\u7528\u5fae\u4fe1 SDK \u7684\u6b65\u9aa4<\/a><\/p>\n<p>\u6d4b\u8bd5\u73af\u5883\uff1a<\/p>\n<ul>\n<li>\u5fae\u4fe1 SDK \u7248\u672c:1.7.2<\/li>\n<li>iOS SDK \u7248\u672c\uff1a9.3<\/li>\n<li><a href=\"https:\/\/github.com\/chinawsb\/QSDK\/\">QSDK <\/a>\u4e2d\u7684\u5fae\u4fe1 SDK \u76f8\u5173\u7684\u5355\u5143\uff1aqsdk.wechat.ios\u3001iOSapi.CFNetwork\u3001iOSapi.SCNetworkReachability\u3001iOSapi.Security<\/li>\n<li>\u5f00\u53d1\u5de5\u5177\uff1aDelphi 10.1<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u6b65\u9aa4\uff1a<\/p>\n<p>1\u3001\u65b0\u5efa\u4e00\u4e2a FMX \u7684\u7a7a\u767d\u5de5\u7a0b\uff1b<\/p>\n<p>2\u3001\u5c06 QSDK \u4e2d\u7684\u76f8\u5173\u5355\u5143\u548c\u5fae\u4fe1 SDK \u7684\u00a0libWeChatSDK.a \u590d\u5236\u5230\u7a0b\u5e8f\u76ee\u5f55\u4e0b\uff08\u4e5f\u53ef\u4ee5\u89c6\u7c7b\u578b\u653e\u5230\u76f8\u5e94\u7684\u641c\u7d22\u8def\u5f84\u4e2d\uff0c\u8fd9\u91cc\u4e3a\u4e86\u65b9\u4fbf\u90fd\u7edf\u4e00\u653e\u5230\u7a0b\u5e8f\u7684\u6e90\u7801\u76ee\u5f55\u4e0b\uff09\u3002<\/p>\n<p>3\u3001\u5728 Project -&gt; Options -&gt; Delphi Compiler -&gt; Linking \u4e2d\uff0c\u627e\u5230 Options passed to the LDLinker\uff0c\u52a0\u5165 -framework CoreTelphony\u3002<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wechartopt.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4094\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wechartopt.jpg\" alt=\"wechartopt\" width=\"756\" height=\"597\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wechartopt.jpg 756w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wechartopt-300x237.jpg 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/a><\/p>\n<p>4\u3001\u76ee\u6807\u5e73\u53f0\u9009\u62e9 iOS \u8bbe\u5907\uff0c\u5148 Build \u4e00\u9879\u8fd9\u4e2a\u65b0\u5de5\u7a0b\uff0c\u4ee5\u4fbf\u751f\u6210 iOS \u7684 info.plist \u6a21\u677f\u6587\u4ef6 info.plist.TemplateiOS.xml\u3002<\/p>\n<p>5\u3001\u5728 IDE \u4e2d\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5728\u00a0&lt;%ExtraInfoPListKeys%&gt; \u548c &lt;\/dict&gt; \u4e2d\u95f4\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">&lt;key&gt;CFBundleURLTypes&lt;\/key&gt;\r\n\t&lt;array&gt;\r\n\t\t&lt;dict&gt;\r\n\t\t\t&lt;key&gt;CFBundleURLName&lt;\/key&gt;\r\n\t\t\t&lt;string&gt;weixin&lt;\/string&gt;\r\n\t\t\t&lt;key&gt;CFBundleURLSchemes&lt;\/key&gt;\r\n\t\t\t&lt;array&gt;\r\n\t\t\t\t&lt;string&gt;!!!!\u4f60\u7684\u5fae\u4fe1\u5f00\u653e\u5e73\u53f0\u5e94\u7528\u7684ID\uff0c\u4e00\u822c\u662f wxnnnnn \u7684\u4e00\u4e32\u503c !!!&lt;\/string&gt;\r\n\t\t\t&lt;\/array&gt;\r\n\t\t&lt;\/dict&gt;\r\n\t&lt;\/array&gt;\r\n  \r\n&lt;key&gt;LSApplicationQueriesSchemes&lt;\/key&gt;\r\n  &lt;array&gt;\r\n  &lt;string&gt;weixin&lt;\/string&gt;\r\n  &lt;\/array&gt;\r\n\r\n&lt;key&gt;NSAppTransportSecurity&lt;\/key&gt;\r\n  &lt;dict&gt;\r\n  &lt;key&gt;NSAllowsArbitraryLoads&lt;\/key&gt;\r\n  &lt;true\/&gt;\r\n  &lt;\/dict&gt;<\/pre>\n<p>\u6ce8\u610f\u66ff\u6362\u4e0b\u4f60\u5fae\u4fe1\u5e94\u7528\u5f00\u53d1\u5e73\u53f0\u7684ID\u3002<\/p>\n<p>6\u3001\u5728\u4e3b\u7a97\u4f53\u4e2d\u5f15\u7528 qsdk.wechat.ios \u548c Macapi.Helpers\uff0c\u7136\u540e\u5728\u7a97\u4f53\u7684OnCreate \u4e8b\u4ef6\u4e2d\u6ce8\u518c\u4f60\u7684\u5e94\u7528\uff0c\u5b9e\u9645\u4e0a\u8fd9\u5728\u4f60\u5e94\u7528\u4f7f\u7528\u5fae\u4fe1\u76f8\u5173\u63a5\u53e3\u4e4b\u524d\u8c03\u7528\u4e00\u6b21\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<pre class=\"lang:delphi decode:true \">procedure TForm2.FormCreate(Sender: TObject);\r\nbegin\r\nTWXApi.OCClass.registerApp(StrToNSStr('\u4f60\u5728\u5fae\u4fe1\u5f00\u653e\u5e73\u53f0\u6ce8\u518c\u7684\u5fae\u4fe1\u5e94\u7528ID'));\r\nend;<\/pre>\n<p>7\u3001\u73b0\u5728\u53ef\u4ee5\u5728\u5176\u5b83\u5730\u65b9\u4f7f\u7528 SDK \u4e86\uff0c\u4e00\u4e2a\u7b80\u5355\u7684\u9a8c\u8bc1\u65b9\u6cd5\u6d4b\u8bd5\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">procedure TForm2.Button1Click(Sender: TObject);\r\nbegin\r\n  if TWeChatHelper.isWXAppInstalled then\r\n    ShowMessage('\u5fae\u4fe1\u5df2\u7ecf\u5b89\u88c5')\r\n  else\r\n    ShowMessage('\u5fae\u4fe1\u672a\u5b89\u88c5');\r\n\r\nend;<\/pre>\n<p>8\u3001\u7f16\u8bd1\u5e76\u8fd0\u884c\u4f60\u7684\u7a0b\u5e8f\u5427\uff0c\u5982\u679c\u6ca1\u5565\u610f\u5916\u7684\u8bdd\uff0c\u5fae\u4fe1\u7684 SDK \u5df2\u7ecf\u5de5\u4f5c\u6b63\u5e38\u4e86\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u6b22\u8fce\u5230 QDAC \u5b98\u65b9QQ\u7fa4 \uff08250530692\uff09\u4e00\u8d77\u8ba8\u8bba\u3002<\/p>\n<p>\u8fd0\u884c\u6548\u679c\u622a\u56fe\u5982\u4e0b\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wexin.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4098\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wexin.jpg\" alt=\"wexin\" width=\"354\" height=\"627\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wexin.jpg 354w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/08\/wexin-169x300.jpg 169w\" sizes=\"auto, (max-width: 354px) 100vw, 354px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Android \u4e2d\u96c6\u6210\u5fae\u4fe1 SDK  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,602],"tags":[651,650],"class_list":["post-4093","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-ios","tag-sdk","tag-650"],"views":4262,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4093"}],"version-history":[{"count":5,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4093\/revisions"}],"predecessor-version":[{"id":4116,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4093\/revisions\/4116"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}