CN115421782A - SDK compatible method applied to iOS terminal, storage device and intelligent terminal - Google Patents
SDK compatible method applied to iOS terminal, storage device and intelligent terminal Download PDFInfo
- Publication number
- CN115421782A CN115421782A CN202211382352.9A CN202211382352A CN115421782A CN 115421782 A CN115421782 A CN 115421782A CN 202211382352 A CN202211382352 A CN 202211382352A CN 115421782 A CN115421782 A CN 115421782A
- Authority
- CN
- China
- Prior art keywords
- sdk
- version
- name
- macro
- header file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000009191 jumping Effects 0.000 claims description 3
- 238000004891 communication Methods 0.000 abstract description 3
- 238000011161 development Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an SDK compatible method applied to an iOS end, which comprises the following steps: determining the model of the SDK version actually required by the iOS end of the client; identifying and judging whether the SDK version name header file or the SDK name introduced by the customer iOS end at this time is consistent with the header file or the SDK name of the SDK version required actually; if not, determining the version model of the SDK version introduced by the iOS end of the client at this time by using macro definition through the SDK name; and header file macro names of models of the SDK version which is introduced according to the version model of the SDK version introduced at this time and actually required. According to the invention, through the use of the macro definition, different files are introduced and different codes are executed by distinguishing the differences of the SDKs of different versions, so that the compatibility of the SDKs of different versions is completed in the same code, the compatibility of the SDKs is improved, and the additional communication cost of developers is saved.
Description
Technical Field
The invention relates to the technical field of SDK compatibility, in particular to an SDK compatibility method, a storage device and an intelligent terminal applied to an iOS terminal.
Background
The SDK is a software development kit, and some software engineers may understand a set of development tools for creating application software for a specific software package, software framework, hardware platform, operating system, and the like as a kit for implementing a certain function of a software product provided by a third-party service provider, where the set of development tools generally appears in the form of a set kpi and documents, paradigms, and tools, that is, a set of many types of files. Typically, an SDK is a collection of professional services provided by companies of a professional nature, such as providing android development tools, or services developed based on hardware, etc. There are also SDKs for a certain software function, such as push technology, image recognition technology, mobile payment technology, etc., and companies with resource advantage also provide SDKs for resource sharing, such as some advertising SDKs providing profit channels and distribution SDKs providing product download channels.
The current introduction of SDK encounters such situations: an SDK of a company at an iOS end (apple cell phone application end) realizes common functions in some live scenes, but part of the functions of the SDK of the company are realized based on SDKs of other manufacturers. It is encountered that the version of the SDK integrated by the customer from other vendors is different from the version of the customer. For example, the customer uses the SDK of 2.x version of the SDK of a vendor, but the customer actually needs the SDK of 3.x version of the vendor, which may cause a part of the SDK of the customer to fail.
Therefore, a solution is needed to solve the problem that one customer can simultaneously be compatible with different versions of SDKs from other vendors.
Disclosure of Invention
In order to solve the technical problem, a compatible method, a storage device and a mobile terminal applied to different versions of SDKs of an iOS terminal are provided, wherein the compatible method is compatible with different versions of SDKs of other manufacturers at the same time.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows: the SDK compatible method applied to the iOS terminal comprises the following steps:
step 1: determining the model of the SDK version actually required by the iOS end of the client;
and 2, step: identifying and judging whether the SDK version name header file or the SDK name introduced by the customer iOS end at this time is consistent with the header file or the SDK name of the SDK version required actually;
if the SDK version is consistent with the actual requirement SDK version, the model of the introduced SDK version is the same as that of the actual requirement SDK version;
if not, jumping to the step 3;
and step 3: determining the version model of the SDK version introduced by the iOS terminal of the client at this time by using macro definition through the SDK name;
and 4, step 4: leading in a header file of the model of the SDK version which is actually required from the version model of the SDK version which is led in this time and defining a macro name;
the steps of importing header files and defining macro names are as follows:
step 4-1: judging whether the current introduced version contains a header file ASDK/a.h of the SDK version which is actually required or not through macro, introducing the header file ASDK/a.h if the current introduced version contains the header file ASDK/a.h, and defining the header file as ASDK;
if ASDK/a.h is not included, but AnewSDK/a.h is included, a.h in AnewSDK is introduced and the macro name is ANEWWSDK;
step 4-2: starting a macro command # ifdef to call a corresponding code block in a header file of a macro name defined according to the step 4-1 in the version of the currently introduced SDK version;
step 4-3: and code modification is carried out on the called corresponding code block according to the method attribute of the model of the actual demand SDK version, so that the modified code block is completely compatible with the model of the actual demand SDK version.
Preferably, the method for judging whether the header file or the SDK name is the same is: and comparing character strings of the header files or the SDK names of the two SDK versions, wherein if the character strings are the same, the character strings are consistent, and otherwise, the character strings are inconsistent.
Preferably, the macro command # ifdef is executed by: calling a header file defining a macro name, and executing a code block between # ifdef and # endif.
A storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to carry out the steps of the above method.
An intelligent terminal comprises a processor for executing each instruction and a storage device for storing a plurality of instructions, wherein the instructions are suitable for being loaded by the processor and executing the step operations of the method.
The invention has the beneficial technical effects that: according to the invention, through the use of the macro definition, different files are introduced and different codes are executed by distinguishing the differences of the SDKs of different versions, so that the compatibility of the SDKs of different versions is completed in the same code, a client does not need to perform additional processing on the code, the compatibility of the SDKs is improved, and the additional communication cost of developers is saved.
Drawings
FIG. 1 is a flow chart of the steps of the method of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments, but the scope of the present invention is not limited to the following embodiments.
As shown in fig. 1, the SDK compatible method applied to the iOS terminal includes the following steps:
step S1: determining the model of the SDK version actually required by the iOS end of the client;
step S2: identifying and judging whether the SDK version name header file or the SDK name introduced by the customer iOS end at this time is consistent with the header file or the SDK name of the SDK version required actually;
the method for judging whether the header file or the SDK name is the same is as follows: and comparing character strings of the header files of the two SDK versions or the SDK names, wherein if the character strings are the same, the character strings are consistent, and otherwise, the character strings are inconsistent.
If the SDK version is consistent with the actual requirement SDK version, the model of the introduced SDK version is the same as that of the actual requirement SDK version; the version of the SDK introduced this time can be used directly.
If not, jumping to the step 3;
and step S3: determining the version model of the SDK version introduced by the iOS terminal of the client at this time by using macro definition through the SDK name;
here, the version model of the currently introduced SDK version is also determined by identifying a header file of the currently introduced SDK version or a character string of the SDK name.
And step S4: and introducing a header file which is the same as the SDK version actually required from the version of the SDK version introduced at this time and defining the macro name.
The macro is defined as: "Macro (Macro), is a name for batch processing. Macros in computer science are abstractions (abstractions) that replace certain text patterns according to a set of predefined rules. The interpreter or compiler will do this mode replacement automatically when it encounters a macro. For compiled languages, macro unrolling occurs at compile time, and the tool that does macro unrolling is often referred to as a macro unroller. "
The step of introducing header file to define macro name is as follows:
step 4-1: whether a header file ASDK/a.h of an SDK version which is actually required is included in the introduced SDK version is judged by a macro (ASDK/a.h represents a header file of a third-party SDK of a low version), if yes, the header file ASDK/a.h is introduced, and the header file is defined as ASDK (the ASDK represents the third-party SDK of the low version);
if ASDK/a.h is not included, but AnewSDK/a.h (representing header file of high version third party SDK represented by Anew) is included, a.h in AnewSDK is introduced and defined as the macro name ANEWSDK (representing low version third party SDK represented by ANEWSDK);
step 4-2: starting a macro command # ifdef (the identifier and the program segment 1 are connected after the ifdef), and the preprocessing command # endif of the program segment 2 and the end condition compiling segment are connected after the # else, which means that if the macro defines a statement 1, a program 2 is executed) to call a corresponding code block in a header file of which the macro name is defined according to the step 4-1 in the version of the currently introduced SDK version;
preferably, the macro command # ifdef is executed by: calling a header file defining a macro name, and executing a code block between # ifdef and # endif.
In this embodiment, the # ifdef statement is used as follows:
#ifdef ASDK
NSLog(@“ASDK”);
#endif
#ifdef ANEWSDK
NSLog(@“AnewSDK”);
#endif
the meaning of the above code execution is: when ASDK is defined, ANEWSDK is not defined, i.e. only # define ASDK, then only the sentence code "NSLog (@" ASDK ") will be executed, but not" NSLog (@ "ANEWSDK");
step 4-3: and modifying the codes of the calling code block according to the method attribute of the model of the actual demand SDK version, so that the modified code block is completely compatible with the model of the actual demand SDK version. The called code block is the code block which introduces the SDK version at this time, and can completely realize a function, but because of the version, the code block cannot be compatible with the SDK version which is actually required by the actual version, the called code block needs to be slightly modified according to the method, the attribute and the like of the model of the SDK version which is actually required, and the code design is finished according to the specific situation when the code is modified, and the corresponding code is stored after the code is modified, so that the modified code block is compatible with the SDK version which is actually required.
A storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to carry out the steps of the above method.
An intelligent terminal comprises a processor for executing each instruction and a storage device for storing a plurality of instructions, wherein the instructions are suitable for being loaded by the processor and executing the step operation of the method.
According to the invention, through the use of the macro definition, different files are introduced and different codes are executed by distinguishing the differences of the SDKs of different versions, so that the compatibility of the SDKs of different versions is completed in the same code, a client does not need to perform additional processing on the code, the compatibility of the SDKs is improved, and the additional communication cost of developers is saved.
Variations and modifications to the above-described embodiments may occur to those skilled in the art, which fall within the scope and spirit of the above description. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and modifications and variations of the present invention are also intended to fall within the scope of the appended claims. Furthermore, although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.
Claims (5)
1. The SDK compatible method applied to the iOS terminal is characterized by comprising the following steps:
step 1: determining the model of the SDK version actually required by the iOS end of the client;
step 2: identifying and judging whether the SDK version name header file or the SDK name introduced by the customer iOS end at this time is consistent with the header file or the SDK name of the SDK version required actually;
if the SDK version is consistent with the actual requirement SDK version, the model of the introduced SDK version is the same as that of the actual requirement SDK version;
if not, jumping to the step 3;
and 3, step 3: determining the version model of the SDK version introduced by the iOS terminal of the client at this time by using macro definition through the SDK name;
and 4, step 4: leading in a header file of the model of the SDK version which is actually required from the version model of the SDK version which is led in this time and defining a macro name;
the steps of importing header files and defining macro names are as follows:
step 4-1: whether a header file ASDK/a.h of an SDK version which is actually required is contained in the introduced version is judged by a macro, if yes, the header file ASDK/a.h is introduced, and the header file is defined as ASDK;
if ASDK/a.h is not included, but AnewSDK/a.h is included, a.h in AnewSDK is introduced and the macro name is ANEWWSDK;
step 4-2: starting a macro command # ifdef to call a corresponding code block in a header file of a macro name defined according to the step 4-1 in the version of the currently introduced SDK version;
step 4-3: and modifying codes of the called corresponding code blocks according to the method attribute of the model of the SDK version required actually, so that the modified code blocks are completely compatible with the model of the SDK version required actually.
2. The SDK compatible method applied to the iOS terminal according to claim 1, wherein the method of determining whether the header file or the SDK name is the same is: and comparing character strings of the header files of the two SDK versions or the SDK names, wherein if the character strings are the same, the character strings are consistent, and otherwise, the character strings are inconsistent.
3. The SDK compatible method applied to the iOS terminal according to claim 1, wherein the macro command # ifdef is executed by: calling a header file defining a macro name, and executing a code block between # ifdef and # endif.
4. A storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the operation of the steps of the SDK compatible method for iOS application according to any of claims 1 to 3.
5. A smart terminal comprising a processor for executing instructions and a memory means for storing a plurality of instructions, characterized in that said instructions are adapted to be loaded by said processor and to perform the SDK compatible method step operations as claimed in any one of claims 1 to 3 applied to an iOS terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211382352.9A CN115421782A (en) | 2022-11-07 | 2022-11-07 | SDK compatible method applied to iOS terminal, storage device and intelligent terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211382352.9A CN115421782A (en) | 2022-11-07 | 2022-11-07 | SDK compatible method applied to iOS terminal, storage device and intelligent terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115421782A true CN115421782A (en) | 2022-12-02 |
Family
ID=84207489
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211382352.9A Pending CN115421782A (en) | 2022-11-07 | 2022-11-07 | SDK compatible method applied to iOS terminal, storage device and intelligent terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115421782A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117251205A (en) * | 2023-11-16 | 2023-12-19 | 沐曦集成电路(杭州)有限公司 | Method, device, equipment and medium for processing header file |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110852259A (en) * | 2019-11-08 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Living body identification method, living body identification system, living body identification apparatus, living body identification device, and computer-readable storage medium |
CN113934438A (en) * | 2021-10-29 | 2022-01-14 | Oppo广东移动通信有限公司 | Software development kit calling method and device, electronic equipment and computer-readable storage medium |
CN114003235A (en) * | 2021-11-01 | 2022-02-01 | 北京技德系统技术有限公司 | Kernel module compiling method and device, computer equipment and storage medium |
-
2022
- 2022-11-07 CN CN202211382352.9A patent/CN115421782A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110852259A (en) * | 2019-11-08 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Living body identification method, living body identification system, living body identification apparatus, living body identification device, and computer-readable storage medium |
CN113934438A (en) * | 2021-10-29 | 2022-01-14 | Oppo广东移动通信有限公司 | Software development kit calling method and device, electronic equipment and computer-readable storage medium |
CN114003235A (en) * | 2021-11-01 | 2022-02-01 | 北京技德系统技术有限公司 | Kernel module compiling method and device, computer equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
痴人指路: "解决多版本sdk兼容问题", 《HTTPS://WWW.CNBLOGS.COM/LIGUN123/P/2758955.HTML》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117251205A (en) * | 2023-11-16 | 2023-12-19 | 沐曦集成电路(杭州)有限公司 | Method, device, equipment and medium for processing header file |
CN117251205B (en) * | 2023-11-16 | 2024-02-06 | 沐曦集成电路(杭州)有限公司 | Method, device, equipment and medium for processing header file |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1014265B1 (en) | Method and apparatus for testing event driven software | |
US7032210B2 (en) | Method and system for generating program source code of a computer application from an information model | |
CN112394942B (en) | Distributed software development compiling method and software development platform based on cloud computing | |
CN110149800B (en) | Apparatus for processing abstract syntax tree associated with source code of source program | |
US20040243988A1 (en) | Compiler, method of compiling and program development tool | |
CN109710260B (en) | Multi-platform-based applet code conversion method | |
Freeman | Essential TypeScript 5 | |
US8949821B2 (en) | Cap file for the personalization of a java application | |
CN111736954A (en) | Multi-intelligent contract virtual machine implementation method, multi-intelligent contract virtual machine and system | |
CN111427583A (en) | Component compiling method and device, electronic equipment and computer readable storage medium | |
CN112148278A (en) | Visual block chain intelligent contract framework and intelligent contract development and deployment method | |
CN110059002B (en) | Test data generation method, test equipment, storage medium and device | |
CN103186463B (en) | Determine the method and system of the test specification of software | |
CN115421782A (en) | SDK compatible method applied to iOS terminal, storage device and intelligent terminal | |
CN112083919A (en) | YAML template-based target service code generation method and device | |
CN110109671A (en) | A kind of webpack label sizes pattern conversion method and device | |
CN113961196A (en) | Method, device and equipment for automatically generating codes and readable storage medium | |
CN110737431B (en) | Software development method, development platform, terminal device and storage medium | |
CN113703779B (en) | Cross-platform multi-language compiling method and ultra-light Internet of things virtual machine | |
CN111338716A (en) | Data processing method and device based on rule engine and terminal equipment | |
CN112905271A (en) | Calling method and device of application program interface API and electronic equipment | |
CN111913692A (en) | Billing engine based on natural language design | |
CN111596970A (en) | Dynamic library delay loading method, device, equipment and storage medium | |
CN111488144A (en) | Data processing method and equipment | |
CN111399842A (en) | Code compiling method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221202 |