公司項目暫時告一段落煎娇,下個版本要集成支付寶二庵,以前集成過,想著隨便再看看缓呛,熟悉熟悉催享。但是遇到了幾個問題,忘了怎么解決了哟绊,也是在網(wǎng)上查了半天睡陪,還問了他們客服,人工客服也是什么都不知道匿情,浪費時間兰迫。
集成時要注意以下幾點
1:要導(dǎo)入的依賴庫,要仔細看挨個導(dǎo)入炬称,我沒有犯過類似的錯誤汁果,少了不少奇怪的問題。
2:按照支付寶文檔上說的玲躯,如果編譯報錯的話据德,要在報錯的文檔中加入
#import <Foundation/Foundation.h> 這個頭文件,這個輕松解決跷车,接著編譯
3:openssl_wrapper.h 這個文件里會報 unknown type name 'BOOL' unknown type name 'NSString'
未知類型的問題 棘利。看支付寶里有個pch文件朽缴,里面導(dǎo)入了 #import <UIKit/UIKit.h>
#import <Foundation/Foundation.h> 這兩個頭文件善玫。我也創(chuàng)建了一個pch文件,也導(dǎo)入密强,按照支付寶 的寫法復(fù)制進去了茅郎,然而并沒什么卵用蜗元,一怒之下,直接寫在了openssl_wrapper.h里系冗,編譯通過奕扣。
4:<per>openssl/asn1.h </per> 這個頭文件找不到,這個問題文檔里也寫了解決辦法了掌敬,但是我看了幾次惯豆,不是太明白,百度了一下奔害,把 Util 和 openssl 這兩個文件夾拖到一個新的文件夾里循帐,再導(dǎo)入到項目中,然后在Build Setting的Header Search Paths中點擊+新建舀武,把導(dǎo)入到項目的新建的文件夾直接拖到輸入框中拄养,解決。
5:報錯:_EVP_DecodeBlock", referenced from: _dataFromBase64String in openssl_wrapper.o.....
支付寶Demo里有兩個 .a 文件银舱,仔細找瘪匿,拖到你的項目中,解決寻馏。
感覺在上線的項目中棋弥,只要導(dǎo)入的依賴庫沒問題,其他的都沒問題诚欠,3 4 5這些問題顽染,都是加密文件報的錯,而支付寶是不允許在客戶端加密的轰绵,Demo只是為了演示才寫的粉寞,實際項目中,我們只要調(diào)取支付的接口左腔,做好回調(diào)就行唧垦。
(隨時補充)
好吧,又被拒了
Your app, extension, and/or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is not in compliance with App Store Review Guideline 2.5.2 and section 3.3.2 of the Apple Developer Program License Agreement.
This code, combined with a remote resource, can facilitate significant changes to your app’s behavior compared to when it was initially reviewed for the App Store. While you may not be using this functionality currently, it has the potential to load private frameworks, private methods, and enable future feature changes. This includes any code which passes arbitrary parameters to dynamic methods such as dlopen(), dlsym(), respondsToSelector:, performSelector:, method_exchangeImplementations(), and running remote scripts in order to change app behavior and/or call SPI, based on the contents of the downloaded script. Even if the remote resource is not intentionally malicious, it could easily be hijacked via a Man In The Middle (MiTM) attack, which can pose a serious security vulnerability to users of your app.
意思是APP使用了外鏈液样,蘋果擔心會有安全漏洞振亮,應(yīng)該就是這兩天才更新的,應(yīng)該是使用了高德地圖的定位SDK的原因鞭莽。因為教師端同樣使用了高德的SDK前幾天審核就通過了坊秸,家長端的周六再次審核被拒。高德也緊急發(fā)布了新的SDK版本澎怒。也給了說明:
"近日褒搔,大量含JS-Patch的應(yīng)用,在蘋果應(yīng)用商店(APP Store)上線審核時遭遇警告,蘋果公司認為它的安全漏洞一旦被人利用站超,用戶數(shù)據(jù)有遭受非法入侵的風險。"
重新提交乖酬,看看能不能通過死相。