preface
Because the current company is doing payment aggregation, for the user is a merchant, so the payment broadcast amount of this part of the user is very important, in ios 12.1 has been used before
There are two ways to broadcast it at the moment
1、UNNotificationServiceExtension
Or use
Stick it on the bottom
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
AudioServicesAddSystemSoundCompletion(soundID, NULL, NULL, &playCallback, (__bridge void * _Nullable)(self));
AudioServicesPlaySystemSound(soundID);
void playCallback(SystemSoundID ssID, void* __nullable clientData) { AudioServicesDisposeSystemSoundID(ssID); selfClass.contentHandler(selfClass.bestAttemptContent); NSLog(@"Play complete..."); }
represents the path to an audio file,
And then at the right moment
2、VOIP
Recently, I have been looking up the problem of broadcasting on the Internet, and I saw that VOIP suddenly had inspiration so I wrote a demo, which can be tested to achieve voice broadcasting, and it can be broadcast even in the case of killing the program, I read this article
However, there are still some restrictions at present, because VOIP is a wake-up mode for VOIP-type apps. However, our app's aggregate payment, ah, has nothing to do with VOIP, moreover, if the VOIP mode was used, the previous push would basically be pushed down. The backend would have to manage tokens for the corresponding users, and they could no longer rely on third parties such as Aurora and carrier pigeons as before, so more time and effort, afraid of your time and effort to do a good job and then be rejected on the sick.
这我在网上找的一个关于怎么审核的可行方案,但是呼入可以录制,但是哪来的呼出呢
1. When uploading an App to the App Store, please fill out the reasons for using VoIP push in the notes at the bottom right of the iTunes Connect upload page, along with a demo link for audio and video calls using the VoIP push feature, the demo must provide both outgoing and incoming functions.
I've put the demo I wrote on the GitHub link
VOIP certificate production to see this
Today, I tested wechat's payment. Even if I kill the program, it will broadcast. So, I can confirm that wechat must be implemented through VOIP, because wechat was originally a VOIP-type program, so it took a minute to go through the examination, but Alipay didn't have the voice chat function, so it couldn't use VOIP, and it had more than 1,000 audio files built into it to collect money, it's a very physical way of pushing the sound field and then controlling it in the background, and it doesn't cover the full amount. For example, if you go to a test and pay $0.12, you won't be able to report the amount, but testing $0.01 will.
I built an ios 12.1 voice broadcast communication group 839097185 can come over to discuss.
Another method came to mind, that is, through the background push to wake up to broadcast the amount, but can not exit the kill program and need to check the background play mode, may be rejected, but can appeal is not know whether to give. Small partners can try to submit it, through the exchange of over the experience.
Actually to use Alipay, found that they did not realize the voice call function, that is, do not know how they passed the trial, it must be a complaint, everyone to take action to do Voip Appeal Trial Ah, ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah Ah.
3. Local push
Local push is breaking the broadcast into one, two, three, four, five... Thousands, millions, millions, points, Yuan and other audio files, according to the amount of push to filter and in order to put into the array, and then loop the array to create and send local push.
The benefits of this method are very intuitive, the package is smaller than the above method, the disadvantage is that the sound is very difficult to hear, very strange, want to make it sound good, it takes a lot of time, in the recording and playback time to think of a way.There is also the local notification will vibrate once every time it is transmitted, such as: the cash register arrives, shake it, nine, shake it, ten thousand, shake it, eight, shake it, thousand, shake it, seven , shake it, shake a hundred, shake one, six, shake one, ten, shake one, five, shake one, point, shake one, four, shake one, three, shake one, yuan, shake one.There is no good way to do this for the time being, but to guide the user to turn off the vibration switch in the settings.In addition, the voice broadcast of local notifications is easily interrupted.
Note: Check both targets when adding the audio file. There was also a local push method. When the APP was at the front desk, there was no sound. The front desk had to go through normal push parsing and normal voice broadcast. Since it was already at the front desk, they could just play it however they wanted.
summary
The first method is abandoned, the package will be successful but upload the package audit when I directly wrong.
Self. Contenthandler (self.bestAttemptContent) ; this means that when the stuff in the extension is done, the push can go to the end of the real APP.
Can also be used in combination with three or four methods, after all, the third method has many drawbacks.