push не работает на сайте с телефона

я пыталась открыть страницу на Android, но push-уведомление работает только на ПК, а на телефоне – нет, в чем может быть проблема? Как настроить push, чтобы оно работало и на телефоне?

function sendNotification(title, options) {         // Проверим, поддерживает ли браузер HTML5 Notifications         if (!("Notification" in window)) {         alert('Ваш браузер не поддерживает HTML Notifications, его необходимо обновить.');         }          // Проверим, есть ли права на отправку уведомлений         else if (Notification.permission === "granted") {         // Если права есть, отправим уведомление         var notification = new Notification(title, options);          function clickFunc() { alert('Пользователь кликнул на уведомление'); }          notification.onclick = clickFunc;         }          // Если прав нет, пытаемся их получить         else if (Notification.permission !== 'denied') {         Notification.requestPermission(function (permission) {         // Если права успешно получены, отправляем уведомление         if (permission === "granted") {         var notification = new Notification(title, options);          } else {         alert('Вы запретили показывать уведомления'); // Юзер отклонил наш запрос на показ уведомлений         }         });         } else {         // Пользователь ранее отклонил наш запрос на показ уведомлений         // В этом месте мы можем, но не будем его беспокоить. Уважайте решения своих пользователей.         }     }      sendNotification('Верните Линуса!', {         body: 'Тестирование HTML5 Notifications',         icon: 'icon-192x192.png',         dir: 'auto'         }); 

What is causing 403 during attempt to push local repository to remote origin on my git server?

I am building a git server to allow my app users to remotely host their projects (similar to Github).

When a user posts a repository, the following function is ran after it’s saved to my database:

@receiver(post_save, sender=Repository) def init_repository(sender, instance, created, **kwargs):     profile = Profile.objects.get(user=instance.user)     folder = f"{profile.folder}/{instance.name}.git"     os.system(f"sudo mkdir -p {folder} && cd {folder} && sudo git --bare init && sudo git update-server-info")     os.system(f"sudo chown -R www-data:www-data . && sudo chmod -R 755 .")  

My intention here is to give www-data full access to the repository. Below is my nginx config:

location ~ /git(/.*)(/.*) {         autoindex on;         alias /var/www/html/git;         fastcgi_pass unix:/var/run/fcgiwrap.socket;         auth_basic "Git Login";         auth_basic_user_file /var/www/html/git/$  1/.htpasswd;         include fastcgi_params;         fastcgi_param REQUEST_METHOD $  request_method;         fastcgi_param SCRIPT_FILENAME $  2;         fastcgi_param GIT_HTTP_EXPORT_ALL "";         fastcgi_param GIT_PROJECT_ROOT /var/www/html/git/$  1;         fastcgi_param PATH_INFO /var/www/html/git/$  1/$  2; } 

I created the above config to allow users to have access to their posted repositories from the cmd line via git smart protocols. Below is where I get stuck:

$   git remote add origin http://xx.xxx.xxx.xxx/git/test_user/test_repo.git $   git push origin master  Username for 'http://xx.xxx.xxx.xxx': test_user Password for 'http://test_user@xx.xxx.xxx.xxx': fatal: unable to access 'http://xx.xxx.xxx.xxx/git/test_user/test_repo.git/': The requested URL returned error: 403 

So authentication is working, but I am unable to access the repository. To get around this, I’ve tried making all files & folders inside /var/www/html/git rwxrwxrwx. I also restarted Nginx and reloaded supervisor. Still get the same error.

How to trigger AVAudioPlayer playback using a remote push notification?

I’m creating an app that has a remotely-triggered alarm. Essentially, I’m trying to trigger a looping MP3 file to play (while the app is backgrounded) when a remote push notification arrives with a particular payload.

I’ve tried using didReceiveRemoteNotification: fetchCompletionHandler:, so that code can be run as a result of receiving a remote notification with a particular userInfo payload.

Here is my attempted didReceiveRemoteNotification: fetchCompletionHandler: from my AppDelegate.m:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {   NSString *command = [userInfo valueForKeyPath:@"custom.a.command"];   if (command) {     UIApplicationState applicationState = [[UIApplication sharedApplication] applicationState];     if ([command isEqualToString:@"alarm"] && applicationState != UIApplicationStateActive) {       // Play alarm sound on loop until app is opened by user       NSLog(@"playing alarm.mp3");       NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"alarm" ofType:@"mp3"];             NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];       NSError *error;       self.player = nil;       self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:&error];       self.player.numberOfLoops = -1; // Infinitely loop while self.player is playing       self.player.delegate = self;       [self.player play];     }   }   completionHandler(UIBackgroundFetchResultNewData); } 

I expected the looping audio file to start playing as soon as the push notification arrived (with the app inactive or backgrounded), but it didn’t. Instead, the audio playback surprisingly began when I then bring the app to the foreground.

What is missing from this approach, and/or can a different way work better?

Can thunderwave push upwards?

Imagine this scenario: You are a 2nd level wizard of the evocation school. Someone messed up (may have been you, but let’s not point fingers) and you are now surrounded by enemies. Then you have a brilliant idea: let’s cast thunderwave on all of them! Since you can sculpt the spell you will be perfectly safe. So you choose as the point of origin where your feet touch the ground and direct the cube upwards from there. You say the magic words and then … ?

I see two possibilities:

  • Those surrounding you are pushed upwards if they fail the save, as that is still “away from you”. They then fall, taking 1d6 damage and likely landing prone.
  • Those in the area are pushed radially if they fail the save, the basic premise of “away from you” overriding the positioning of the effect. You may have room to breathe, but getting away is still problematic.

Is either one supported by the rules? Is there a 3rd option?

Mailserver push to gmail

I have a local mail server, running on my own custom domain.

I have set it up as an alias in my gmail account, and use gmail to send and receive emails via said server instead of logging into it directly.

It works well.

The only real downfall is that gmail only checks POP every hour or so. Ideally I’d like this to be a little more responsive.

Is there an API I can hit that informs gmail that a new message is available on my mailserver, and it should run a POP job now? My basic idea of the workflow would be as follows;

  1. I receive a message on my mailserver.
  2. This triggers a script which can do whatever is required. Ideally in a non-evil way.
  3. The result of step 2 is gmail knowing that it needs to do a POP update, either for the account or more ideally the single relevant address.

Is there a way to pull this off? For bonus points, can it be done in a such a way that avoids me needing to know gmail credentials – as then I could use the same method to quickly update client’s inboxes as well.

Jenkins pipeline is not running on Github push

I want to use Jenkins pipelines to get Sonarqube to comment on pull requests.

I’ve set up a pipeline project (not multibranch) but am having difficulty getting it to build.

I’m using Jenkins to manage my Github hooks and have verified that the hook is being sent (by checking Github) and being received (by checking my Jenkins log file).

My Jenkins log file includes this line:

2019-05-29 10:54:59.786+0000 [id=11666] INFO    o.j.p.g.PullRequestGHEventSubscriber#onEvent: Received PULL_REQUEST for https://github.com/user/repository from 140.82.115.71 ⇒ https://example.com/github-webhook/ 

So the webhook is definitely being picked up.

I have checked the “Github” project box and given the github project url. There is nowhere to add a SCM option in the pipeline configuration.

When I look at the Github log for the pipeline I can see it has never been called.

I do have a separate freestyle project that is configured to use SCM polling on this repository. That project is used to run the unit tests and do other analysis, and I want the pipeline to run Sonarqube analysis and comment on the PR.

I have seen other people commenting that you need to build the pipeline at least once before it is able to run off an SCM hook. I’ve done this and had that job complete successfully.

What am I doing wrong?

adb push not working on /system, read only

I can do adb push to /sdcard/ location but not /system on my android device.

sudo adb push lib/audio.primary.gmin.so system/lib/hw/ failed to copy 'lib/audio.primary.gmin.so' to 'system/lib/hw/audio.primary.gmin.so': Read-only file system 

I tried some suggestions online

user$   adb remount dm_verity is enabled on the system partition. Use "adb disable-verity" to disable verity. If you do not, remount may succeed, however, you will still not be able to write to these volumes. remount of /system failed: Read-only file system remount failed user$   adb disable-verity Verity already disabled on /system 

Even after this, remount fails

user$   adb remount dm_verity is enabled on the system partition. Use "adb disable-verity" to disable verity. If you do not, remount may succeed, however, you will still not be able to write to these volumes. remount of /system failed: Read-only file system remount failed 

running below command on PC also does not work

sudo mount -o remount,rw /system mount: can't find /system in /etc/fstab or /etc/mtab 

What should I do?

EDIT.

   which mount     /bin/mount  adb version Android Debug Bridge version 1.0.32 

The output of mount command is as below

user$   mount /dev/sda6 on / type ext3 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) gvfs-fuse-daemon on /home/user/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user) /dev/sda5 on /media/Data type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) /dev/sda2 on /media/OS type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) 

Implement Push Notification in my iOS App with a Drupal backend

I building an iOS App whose content is being brought from a Drupal site. It is being built in ionic/AngularJS.

I intend to implement “Push Notification” functionality in my app that whatever notification a user sends through my Drupal site is received on my app.

There is a particular module Push Notification, made specifically for this and has integration with Services, but I can’t seem to figure out how I’ll show the Push Notification on my app when it’s sent from my Drupal site. Probably some small example?

Any help would be highly appreciated.