App Notification Library for Jailbroken Devices
Requires iOS10+
This library can be used in a process or a tweak. You can set up a rocketbootstrap server in SpringBoard if you're using in a sandboxed process & run this code there.
How to use in your tweak:
#include<dlfcn.h>@interfaceCPNotification : NSObject
+ (void)showAlertWithTitle:(NSString*)titlemessage:(NSString*)messageuserInfo:(NSDictionary*)userInfobadgeCount:(int)badgeCountsoundName:(NSString*)soundNamedelay:(double)delayrepeats:(BOOL)repeatsbundleId:(nonnull NSString*)bundleIduuid:(NSString*)uuidsilent:(BOOL)silent;
+ (void)hideAlertWithBundleId:(NSString *)bundleIduuid:(NSString*)uuid;
@end
- (void)showNotification {
void *handle = dlopen("/usr/lib/libnotifications.dylib", RTLD_LAZY);
if (handle != NULL) { NSString *uid = [[NSUUIDUUID] UUIDString]; [objc_getClass("CPNotification") showAlertWithTitle:@"Holy Smokes!"message:@"This is the message!"userInfo:@{@"" : @""}
badgeCount:1soundName:nil//research UNNotificationSounddelay:1.00//cannot be zero & cannot be < 60 if repeats is YESrepeats:NObundleId:@"com.apple.MobileSMS"uuid:uid //specify if you need to use hideAlertWithBundleId and store the string for later usesilent:NO];
dlclose(handle);
}
}
The app must have notification privileges. To do this you can add this BOOL to the Info.plist file for an app in /Applications:
<key>SBAppUsesLocalNotifications</key>
<true/>