MOJi辞書之手动集成Tencent SDK遇到的坑!!!

手动集成的原因

由于腾讯未把Tencent SDK上传到Github中,所以我们不能通过Cocoapods的方式集成,只能通过官方下载其SDK手动集成。

Tencent SDK手动集成步骤

1.访问腾讯开放平台SDK下载界面,找到并下载iOS_SDK_V3.5.1。(目前最新)

2.解压该压缩包,会看到TencentOpenApi(Lite)_3文件夹,里面的两个文件(TencentOpenApi_IOS_Bundle.bundle、TencentOpenAPI.framework)就是我们要集成进行的;

3.将以上两个文件导入到项目中,如图所示:

导入TencentOpenAPI框架

4.项目添加QQ白名单(把以下schemes添加到项目的info.plist,以源码的方式打开即可):

<key>LSApplicationQueriesSchemes</key>
<array>
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqqopensdkapiV4</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqqbrowser</string>
<string>mttbrowser</string>
</array>

5.添加URL Type,登录腾讯开放平台,获取已经注册好的应用ID,来注册URL Schemes,为tencent+APP ID

6.在腾讯开放平台验证Universal Link。(举例:https://m.mojidict.com/qq_conn/APPID,这一步很重要,涉及到跳转回第三方APP事件)

7.导入依赖框架:

Foundation.framework
UIKit.framework
libc++.tbd
libsqlite3.tbd
Security.framework
libz.tbd
libiconv.tbd
CoreTelephony.framework
CoreGraphics.framework
SystemConfiguration.framework
libz.1.1.3.tbd

8.最后,编译并运行项目,Xcode未报错。So easy的感觉,看似集成成功了!😒

但是…

当导入以下框架并初始化SDK时,

#import <TencentOpenAPI/TencentOAuth.h>
#import <TencentOpenAPI/QQApiInterface.h>


[[TencentOAuth alloc] initWithAppId:MOJiQQAppID andUniversalLink:MOJiQQAppUniversalLink delegate:self];

报错如图所示:

错误1
错误2
错误3

网上查了各种资料都不好使!!!!真的,什么都查过了。试了,还是无解!

突然想到腾讯技术客服…要不问问???

我TM放弃了!!

腾讯没有客服啊…

后面尝试运行官方提供的demo,编译是可以通过的。但是为什么我这里创建的项目就不好使了呢??

一度怀疑人生…

此时经过一番折腾…

然后直盯盯地看着这些错误警告,不知怎滴,突然发现:

上面几张图中,其中错误1、错误3,这两张图,反馈的错误是不能构建模块TencentOpenApi,奇怪了,为什么腾讯的SDK开放给我们的头文件,会有如下导入操作:

#import "sdkdef.h"
#import "QQApiInterfaceObject.h"


注意,我们在自定义框架的时候,都会有这么一段话:

// In this header, you should import all the public headers of your framework using statements like #import <XXX/PublicHeader.h>

然后给外部使用的头文件中,也需要以这这种方式导入头文件,这时候找到对应的头文件,手动分别修改为:

#import <TencentOpenAPI/sdkdef.h>
#import <TencentOpenAPI/QQApiInterfaceObject.h>

修改后图示:

把#import “sdkdef.h”改为#import <TencentOpenAPI/sdkdef.h>
把#import “QQApiInterfaceObject.h”改为#import <TencentOpenAPI/QQApiInterfaceObject.h>

继续步骤8…

9.再次编译运行项目,成功!!!(没办法,只能手动在框架里面修改了)



总结:

1.腾讯的SDK文档老旧,很多操作步骤都是多余的,不建议大家看,直接看这里即可;
2.腾讯做的框架,很垃圾!!没严格按规范编写(仅框架导入头文件这一问题就坑了不少人);
3.项目尽可能严格按照规范来,每次都要Code Review,毕竟我们做的会是一个系统级别的项目;
4.由于一直认为腾讯的产品都是很牛逼,所以一开始就没从Tencent SDK上找原因,当时就一直在查看Xcode或者项目哪里配置出问题了。(中间倒腾了好几回)

所以说,要有敢于怀疑的精神。

15 Important Facts That You Should Know About Best CBD Oil

Several people use cannabidiol CBD oil for a cure for chronic pain. And of course, this is how it is possible to build your group and overall organisation sales. The first way this can cause more sales is because you might realize there are different products your customers will enjoy. An individual can take it . CBD oil is taken out of the cannabis plant, and it includes a chemical compound that is found naturally in marijuana and hemp crops. How to use these different CBD goods best cbd oil and what advantages and disadvantages which they have, we now clarify in the detail on the respective product types. To sum up this measure… all you’re doing is directing people who you’re already participating with, to take a look at the products on your replicated site, utilizing a very simple link.

An individual can look for money back guarantee if not pleased with the item. As there are various CBD goods and because CBD can be used in various ways, the question of how to use CBD oil is very valid. It’s possible to earn money selling best cbd oil products and it can be a lucrative journey if you follow the ideal procedure. But when it comes to selecting the ideal system, it depends very much on the optimal dose in your situation, the outcomes you would like to achieve, and the length of time you need its consequences to continue. Related Reviews.

Mind boggling discounts and offers by availing best cbd oil Coupon on Thanksgiving brand new year. This ‘s it from me, I hope you found this article helpful! Additionally, discounts are available now. All things considered, this is network marketing! Isolates Isolates could be ingested by dabbing.

It is to be noted that CBD affects everybody so it depends upon the individual to select the correct product and dose. The item is thought to include free delivery for orders over and gives simple returns. View all donations by Eldred Matthew.

Literally anytime a person in your group makes sales, you earn a portion of this. This will answer some of your queries regarding the payment plan and business opportunity. The products come with a wide range which is coming with different dimensions and taste. Tinctures, which could also be consumed by mixing into juice or smoothie.

What CBD goods are available, how they can be utilized, and the bioavailability of each product is covered in this report. So, what is the ideal approach to use CBD oil? Get this procedure right and you’ll be making more sales than you ever believed possible. best cbd oil includes two themes that are CBD Salve and CBDefine Skin Care cream that includes mg of CBD.

Eldred Matthew covers Healthcare Sector Company current Press Releases news updates. The website also gives secure and easy payment. Different sizes includes mg, mg, mg, mg and mg Tincture. The next way is that quite frequently, customers will end up distributors. I highly suggest that you browse my best cbd oil inspection related to above before doing something else. A few of the Products are as follows.

Thus, again, it’s a matter of personal preference and desired effect. The main idea behind each of the methods of using CBD is to make sure this cannabinoid ends up in your system in an easy fashion, producing the outcomes you desire. An individual can mix it with coffee that makes it in slab and powder form. Products that they might not be aware of or ones that they harbor ‘t tried yet.

Keep on going to the web site for more details. CBD administered orally may create effects that last more, a couple of hours in a row, although it takes more for CBD to take effect, which will be somewhere between minutes or an hour and a half by the time of administration of the http://cbdreamers.com/best-cbd-oils goods. Apart from supplying other health benefits, CBD oil helps alleviate inflammation, pain and also lessen the total discomfort that is associated with different health conditions. CBD oil is available in many diverse forms.

Users may consume it by dabbing. He performs evaluation of Healthcare Companies and provides worthy information for investor community. He is a seasoned author with a precise grasp of the English language and a clear, compelling writing style. Wax is considered to be natural terpenes and combination of CBD and CBG.

Instead of annoying people, you’re now currently helping people and making constant sales in the procedure. And one of the greatest benefits to community promotion is building a group of people under you who’ll go out and create sales for you. The majority of people who use CBD prefer the types that are not for smoking, but contrary to what people may believe, although vaping is great for convenient use and for rapid action in only a couple minutes. CBD comes in many different forms, for example oil, tincture, oil for vaping, sublingual spray, edibles, and topical lotions, which means you are able to pick the method that’s most acceptable for your usage. A simple, non pushy, dialog could both help your customer and increase your sales, while ensuring long term repeat business. So by engaging with your customers you’ve got the opportunity to present them into the business opportunity and build your team.

Capsules that comes in two different variables that are complete spectrum and isolates. So, there isn’t an overall rule when it comes to using CBD solutions. Besides, cannabidiol isn’t a psychoactive compound unlike the other main active cannabinoid called THC, which causes the large feeling frequently connected to cannabis. Offered in various variety which is made with Coconut MCT oil and expressed Hemp oil. The effect lasts for a few hours. An individual could make out by studying the products advice, if not please do consult a doctor.

In my view, this is the best possible way to begin selling these CBD products without hassling your family and friends. Following up with your customers to be sure they are happy, is essential to your longterm success. Does this show your customers that you care, but it can also cause more sales.

Customer service for / is also accessible which be sure to maintain customer satisfaction.