CN103532972A - Method for running APP in background in IOS (iphone operation system) - Google Patents
Method for running APP in background in IOS (iphone operation system) Download PDFInfo
- Publication number
- CN103532972A CN103532972A CN201310509258.XA CN201310509258A CN103532972A CN 103532972 A CN103532972 A CN 103532972A CN 201310509258 A CN201310509258 A CN 201310509258A CN 103532972 A CN103532972 A CN 103532972A
- Authority
- CN
- China
- Prior art keywords
- business
- wing
- client
- music
- app
- 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.)
- Granted
Links
Images
Abstract
The invention relates to a method for running APP in the background in the IOS. The method comprises the steps that a business engine server establishes a long connection with a business wing client, pushes a tcp order through google protocol buffer, receives a request of the business wing client, sends a processing request according to the request, sends an activating order to the business wing client, performs inverse analysis after receiving a socket, and stops playing background music after receiving the order; the business wing client receives the activating order request sent by the business engine server, starts an APP program, sets silent music in the APP, sets audio mixing, plays silent music and triggers a callback function, and then the APP runs for a long time in the background; and silent music is set according to the business wing client, an audio file is obtained, the parameter Vollumn is set as 0, the callback is initialized, a loudspeaker is triggered, and the silent music is played. According to the method, background APP running is achieved for the IOS, and background downloading, voice and mail transceiving functions of the APP are finished.
Description
Technical field
The present invention relates to a kind of method of the system APP running background for IOS.
Background technology
At present, the APP in traditional IOS system sequentially enters backstage, will enter suspended state, and program is not in operation, and current state variable is saved.Resource is released, and while again clicking other application programs, system can go to respond at once other application programs by whole resources, so it is fast especially to open the speed of application program in IOS system, but this brings series of malpractice also can to many APP.Such as, voice call software, P2P downloads class software (downloading movies etc. on backstage).Because user can not keep mobile phone screen light yellow always, allow APP all the time in foreground, the state living.So under general case, APP enters after backstage or automatic screen locking, resource is released.That is to say that voice call software does not again receive phone, backstage download class software downloads to half also can be stopped.
Official's solution that apple provides is, the APNS server push of apple, send a push notice only need to apple server, the APNS server of apple just can find the apple equipment of any networking in the world, and send this push notice, similar effect can have with reference to QQ the sending out notice of an informal voucher on backstage.There are two maximum problems in this solution, one, ageing, this notice is issued equipment by apple server, may need 5 seconds, also may need 20-30 second, for voice call software, this time almost surpasses the time of hanging up of calling party, they are two years old, unsteadiness, it is unreliable that apple official document clearly states push notice, and easy packet loss.
Based on the problems referred to above, need to research and develop a kind of new APP running background mechanism, can maintain App, even if enter backstage, also can move, be not subject to the restriction of system.
Summary of the invention
The object of the invention is to overcome the deficiency that prior art exists, a kind of method of the system APP running background for IOS is provided.
Method for the system APP running background of IOS, comprises the following steps:
1) first, business holds up server and sets up long a connection with business's wing client, by tcp order of the protocol buffer of Google protocol propelling, and receive the request of business's wing client, according to the request of business's wing client, and transmission processing request, then send activation command to business's wing client, business's wing client, after socket, carries out contrary parsing, stops playing Background music after receiving orders;
2) business's wing client is held up the activation command request that server end sends receiving business, opens APP program, and noiseless music is set in APP, and then audio mixing is set, and plays noiseless music, triggers call back function, and last APP is in backstage long-time running;
3) according to business's wing client, noiseless music is set, obtains audio file, V parameter ollumn is set to 0, and initialization callback triggers loud speaker, plays noiseless music.
Further, the method of the above-mentioned system APP running background for IOS, business's wing client and rear Tianwan businessman hold up server and maintain that TCP is long to be connected, when have missed call, do not read new mail, new information, after realizing ios backstage, by holding up with business the instruction that server sends, be associated, realize background function.
Further, the method for the above-mentioned system APP running background for IOS, describedly arranges noiseless music and comprises the following steps:
1) prepare noiseless music file;
2) audio player of initialization, AVAudioPlayer, and volume is set is 0;
3) call back function that audio frequency receives is set, and audio mixing attribute is set, not disturbed by other app that take audio frequency;
4) start to play music;
5) after music completes, enter in set call back function, then continue to play, form a circulation.
Again further, the method for the above-mentioned system APP running background for IOS, described music file is slience.mp3.
Again further, the method for the above-mentioned system APP running background for IOS, described call back function is a function calling by function pointer.
Again further, the method for the above-mentioned system APP running background for IOS, the pointer address of function passes to another function as parameter, when this pointer is used as while calling its function pointed, is call back function; Call back function be can't help the realization side of this function and is directly called, but by an other side, is called when event or condition occur, for event or condition are responded, and for after audio reception plays, an execution point that enters code.
The substantive distinguishing features that technical solution of the present invention is outstanding and significant progressive being mainly reflected in:
The system that the present invention is directed to IOS realizes APP at running background, realizes new backstage mechanism, maintains App, even if enter backstage, also can move, and is not subject to the restriction of system.Fast response time, good stability, can pass through local sending out notice, better completes the function such as backstage download, backstage voice, backstage mail transmission/reception of APP, has superior instantaneity, stronger autgmentability and one-way.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, technical solution of the present invention is described further:
Fig. 1: schematic flow sheet of the present invention;
Fig. 2: the schematic flow sheet that noiseless music is set.
Embodiment
As shown in Figure 1, for the method for the system APP running background of IOS, concrete steps are:
1) first, business holds up server and sets up long a connection with business's wing client, by tcp order of the protocol buffer of Google protocol propelling, and receive the request of business's wing client, according to the request of business's wing client, and transmission processing request, then send activation command to business's wing client, business's wing client, after socket, can carry out contrary parsing, stops playing Background music after receiving orders; Such as: (void) sendGetAddrLikeTcpSocket
{
[self?initContactSocket];
GetAddrLike_RpcRequest?*request?=?[[[GetAddrLike_RpcRequest?builder]?clear]?build];
NSData?*sendData?=?[request?data];
NSMutableData?*lastSendData?=?[app?packageWithEwdrpc:sendData?method:@"GetAddrLike"?rpcType:1];
[contactSocket?readDataWithTimeout:2.0?tag:KGetAddrLikeTcpSocket];
[contactSocket?writeData:lastSendData?withTimeout:2.0f?tag:KGetAddrLikeTcpSocket];
}
Obtain tcp order of buddy list.
2) business's wing client is held up the activation command request that server end sends receiving business, opens APP program, and noiseless music is set in APP, and then audio mixing is set, and plays noiseless music, triggers call back function, and last APP is in backstage long-time running;
Voip socket is set, for this attribute of socket channel setting of voice call, even because in communication process, user's screen locking or be retracted into backstage or automatically screen locking, this call all can not killed release by system
;on backstage, every 60 seconds, play one section of noiseless music of 0.1 second, this is in order to tell system, is currently playing music, even if enter backstage, also it is not discharged; App can move on backstage, constantly can play music again, so may affect very much other music class software, cause everybody to rob mutually audio resource, situation about easily occurring is, user enters backstage by app, and go to play other music, after arriving 60 second interval time, play noiseless music, now audio resource is seized by app, and other softwares of playing music can be suspended.And by audio mixing is set, app can be coexisted with other music, and be noiseless music, so user's impression is less than there is any other noise in playing process.App just can complete running background, also can receive user's phone, receives mail.
3) according to business's wing client, noiseless music is set, obtains audio file, V parameter ollumn is set to 0, and initialization callback triggers loud speaker, plays noiseless music.
Business's wing client is held up server with rear Tianwan businessman all the time and is maintained that TCP is long to be connected, when have missed call, do not read new mail, new information etc., after realizing ios backstage, by holding up with business the instruction that server sends, be associated, thereby realize the background function of real meaning.
The concrete steps of noiseless music are set as shown in Figure 2:
1) prepare a noiseless music file, as be slience.mp3;
2) audio player of initialization, AVAudioPlayer, and volume is set is 0;
3) call back function that this audio frequency receives is set, and audio mixing attribute is set, not disturbed by other app that take audio frequency;
4) start to play music;
5) after music completes, enter in set call back function, then continue to play, form a circulation.
Call back function is a function calling by function pointer, passes to another function using the pointer address of function as parameter, when this pointer is used as while calling its function pointed, is call back function; Call back function be can't help the realization side of this function and is directly called, but by an other side, is called when event or condition occur, for event or condition are responded, and for after audio reception plays, an execution point that enters code.
In sum, the system that the present invention is directed to IOS realizes APP at running background, realizes new backstage mechanism, maintains App, even if enter backstage, also can move, and is not subject to the restriction of system.Fast response time, good stability, can pass through local sending out notice, better completes the function such as backstage download, backstage voice, backstage mail transmission/reception of APP, has superior instantaneity, stronger autgmentability and one-way.
It is to be understood that: the above is only the preferred embodiment of the present invention; for those skilled in the art; under the premise without departing from the principles of the invention, can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.
Claims (6)
1. for the method for the system APP running background of IOS, it is characterized in that comprising the following steps:
1) first, business holds up server and sets up long a connection with business's wing client, by tcp order of the protocol buffer of Google protocol propelling, and receive the request of business's wing client, according to the request of business's wing client, and transmission processing request, then send activation command to business's wing client, business's wing client, after socket, carries out contrary parsing, stops playing Background music after receiving orders;
2) business's wing client is held up the activation command request that server end sends receiving business, opens APP program, and noiseless music is set in APP, and then audio mixing is set, and plays noiseless music, triggers call back function, and last APP is in backstage long-time running;
3) according to business's wing client, noiseless music is set, obtains audio file, V parameter ollumn is set to 0, and initialization callback triggers loud speaker, plays noiseless music.
2. the method for the system APP running background for IOS according to claim 1, it is characterized in that: described business's wing client and rear Tianwan businessman hold up server and maintain that TCP is long to be connected, when have missed call, do not read new mail, new information, after realizing ios backstage, by holding up with business the instruction that server sends, be associated, realize background function.
3. the method for the system APP running background for IOS according to claim 1, is characterized in that: describedly noiseless music is set comprises the following steps:
1) prepare noiseless music file;
2) audio player of initialization, AVAudioPlayer, and volume is set is 0;
3) call back function that audio frequency receives is set, and audio mixing attribute is set, not disturbed by other app that take audio frequency;
4) start to play music;
5) after music completes, enter in set call back function, then continue to play, form a circulation.
4. the method for the system APP running background for IOS according to claim 3, is characterized in that: described music file is slience.mp3.
5. according to the method for the system APP running background for IOS described in claim 1 or 3, it is characterized in that: described call back function is a function calling by function pointer.
6. the method for the system APP running background for IOS according to claim 5, is characterized in that: using the pointer address of function as parameter, passing to another function, when this pointer is used as while calling its function pointed, is call back function; Call back function be can't help the realization side of this function and is directly called, but by an other side, is called when event or condition occur, for event or condition are responded, and for after audio reception plays, an execution point that enters code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310509258.XA CN103532972B (en) | 2013-10-25 | 2013-10-25 | Method for running APP in background in IOS (iphone operation system) |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310509258.XA CN103532972B (en) | 2013-10-25 | 2013-10-25 | Method for running APP in background in IOS (iphone operation system) |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103532972A true CN103532972A (en) | 2014-01-22 |
CN103532972B CN103532972B (en) | 2017-01-18 |
Family
ID=49934651
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310509258.XA Active CN103532972B (en) | 2013-10-25 | 2013-10-25 | Method for running APP in background in IOS (iphone operation system) |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103532972B (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103761333A (en) * | 2014-02-14 | 2014-04-30 | 北京中文在线数字出版股份有限公司 | Wireless txt reader and reading method thereof |
CN103916405A (en) * | 2014-04-25 | 2014-07-09 | 厦门享游网络科技有限公司 | Method for guiding flow of TCP/UDP of App on IOS |
CN104199632A (en) * | 2014-08-04 | 2014-12-10 | 百度在线网络技术(北京)有限公司 | Method and device used for determining setting of sound effect |
CN105335242A (en) * | 2015-11-02 | 2016-02-17 | 传线网络科技(上海)有限公司 | Method and system for downloading video file at background in IOS system |
CN105760185A (en) * | 2014-12-19 | 2016-07-13 | 北京奇虎科技有限公司 | Background running method and device for application |
CN106126355A (en) * | 2016-06-22 | 2016-11-16 | 百度在线网络技术(北京)有限公司 | Event transmission method based on iOS system and device |
CN107995273A (en) * | 2017-11-27 | 2018-05-04 | 北京酷我科技有限公司 | A kind of iOS network management strategies |
CN109495549A (en) * | 2018-10-30 | 2019-03-19 | 上海连尚网络科技有限公司 | Method, equipment and the computer storage medium of work are drawn in a kind of application |
CN109714640A (en) * | 2017-10-26 | 2019-05-03 | 创盛视联数码科技(北京)有限公司 | The method for playing live video |
CN111176809A (en) * | 2019-12-18 | 2020-05-19 | 任子行网络技术股份有限公司 | Application keep-alive processing method and system containing long-connection communication process under android platform |
CN111538541A (en) * | 2019-12-06 | 2020-08-14 | 杭州当虹科技股份有限公司 | Method for enabling Android App to stably run in background for long time |
CN112445539A (en) * | 2019-09-02 | 2021-03-05 | 珠海市魅族科技有限公司 | Method, device, electronic equipment and storage medium for identifying disguised music playing |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120203880A1 (en) * | 2011-02-03 | 2012-08-09 | Odyssey Software, Inc. | Method and system for establishing a dlp-compliant environment |
-
2013
- 2013-10-25 CN CN201310509258.XA patent/CN103532972B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120203880A1 (en) * | 2011-02-03 | 2012-08-09 | Odyssey Software, Inc. | Method and system for establishing a dlp-compliant environment |
Non-Patent Citations (1)
Title |
---|
IOS开发者博客: "实现iOS长时间后台的两种方法:Audiosession和VOIP", 《COCOA CHINA苹果开发中文站 业界动态 HTTP://WWW.COCOACHINA.COM/INDUSTRY/20121212/5313.HTML》, 12 December 2012 (2012-12-12) * |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103761333A (en) * | 2014-02-14 | 2014-04-30 | 北京中文在线数字出版股份有限公司 | Wireless txt reader and reading method thereof |
CN103916405A (en) * | 2014-04-25 | 2014-07-09 | 厦门享游网络科技有限公司 | Method for guiding flow of TCP/UDP of App on IOS |
CN103916405B (en) * | 2014-04-25 | 2017-02-22 | 厦门享游网络科技有限公司 | Method for guiding flow of TCP/UDP of App on IOS |
CN104199632A (en) * | 2014-08-04 | 2014-12-10 | 百度在线网络技术(北京)有限公司 | Method and device used for determining setting of sound effect |
CN105760185A (en) * | 2014-12-19 | 2016-07-13 | 北京奇虎科技有限公司 | Background running method and device for application |
CN105335242A (en) * | 2015-11-02 | 2016-02-17 | 传线网络科技(上海)有限公司 | Method and system for downloading video file at background in IOS system |
CN105335242B (en) * | 2015-11-02 | 2019-03-26 | 传线网络科技(上海)有限公司 | The method and system of backstage to download video files in IOS system |
CN106126355A (en) * | 2016-06-22 | 2016-11-16 | 百度在线网络技术(北京)有限公司 | Event transmission method based on iOS system and device |
CN109714640A (en) * | 2017-10-26 | 2019-05-03 | 创盛视联数码科技(北京)有限公司 | The method for playing live video |
CN107995273B (en) * | 2017-11-27 | 2021-02-09 | 北京酷我科技有限公司 | iOS network management method |
CN107995273A (en) * | 2017-11-27 | 2018-05-04 | 北京酷我科技有限公司 | A kind of iOS network management strategies |
CN109495549A (en) * | 2018-10-30 | 2019-03-19 | 上海连尚网络科技有限公司 | Method, equipment and the computer storage medium of work are drawn in a kind of application |
CN109495549B (en) * | 2018-10-30 | 2021-07-20 | 上海尚往网络科技有限公司 | Method, equipment and computer storage medium for application pull alive |
CN112445539A (en) * | 2019-09-02 | 2021-03-05 | 珠海市魅族科技有限公司 | Method, device, electronic equipment and storage medium for identifying disguised music playing |
CN111538541A (en) * | 2019-12-06 | 2020-08-14 | 杭州当虹科技股份有限公司 | Method for enabling Android App to stably run in background for long time |
CN111176809A (en) * | 2019-12-18 | 2020-05-19 | 任子行网络技术股份有限公司 | Application keep-alive processing method and system containing long-connection communication process under android platform |
Also Published As
Publication number | Publication date |
---|---|
CN103532972B (en) | 2017-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103532972A (en) | Method for running APP in background in IOS (iphone operation system) | |
JP6352961B2 (en) | System and method for topic-based separation in instant messaging | |
US9501259B2 (en) | Audio output device to dynamically generate audio ports for connecting to source devices | |
US7313134B2 (en) | Proxy server for relaying VOIP messages | |
US10264130B2 (en) | Integrated visual voicemail communications | |
CN110602681B (en) | Information processing method and electronic device | |
GB0308991D0 (en) | A data access replication or communication system comprising a distributed software application | |
US8953471B2 (en) | Counteracting spam in voice over internet protocol telephony systems | |
EP2083606A3 (en) | Multi-standby mobile terminal and host function providing method for the same | |
US20150341432A1 (en) | Grouping method, client, server, and system | |
US10104067B2 (en) | Providing a masked short message service in a wireless network | |
CN103761123B (en) | Function activating method, device and terminal | |
CN103986842B (en) | A kind of collecting method and device of contact data | |
CN104579710A (en) | Method for conference member to issue voice information in fragmentation asynchronous conference system | |
CN112910955A (en) | Cloud and edge data communication method and device and edge computing system | |
CN104579712A (en) | Method for conference member to issue character information in fragmentation asynchronous conference system | |
WO2014180245A1 (en) | Cloud terminal upgrade processing method and device therefor | |
CN103297522A (en) | Method for resource sharing by peer-to-peer technology based on wireless local area network | |
CN113411759A (en) | Voice call transfer method and electronic equipment | |
WO2016150333A1 (en) | Method and system for realizing intercommunication of voice mailbox system and syncretic communication systems | |
WO2011134256A1 (en) | Method and device for processing parallel conflict in mobile terminal | |
WO2011103739A1 (en) | Method for information sharing in mobilephone conference call, master control side and auxiliary control side used in mobilephone conference call system | |
CN102932214A (en) | Discovery polymerization method of home network heterogeneous media equipment | |
WO2018099284A1 (en) | Communication method and apparatus | |
WO2012028062A1 (en) | Method and system for transmitting instant information during call |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170714 Address after: The streets of Shenzhen city in Guangdong province 518057 Keyuan Road No. 15 Nanshan District Guangdong Kexing Science Park building B4 room 1102 Patentee after: SHENZHEN DANALE TECHNOLOGY CO., LTD. Address before: Suzhou City, Jiangsu province 215021 Xinghu Park Street No. 328 Creative Industry Park 3-B302 unit Patentee before: Suzhou Dana Information Technology Co., Ltd. |
|
TR01 | Transfer of patent right |